您好,欢迎访问三七文档
IntroductiontoMetropolisLightTransportAnIntuitiveApproachMarkColbertOverview•MonteCarlo•VarianceReduction•MetropolisSampling•PathTracing•MetropolisLightTransportMonteCarloZΩf(u)du=1NN∑i=1f(Xi)p(Xi)ZΩf(x)dxWewanttosolvethis:ProbabilityDensityFunctions•TraditionalMonteCarlo•UseUniformProbability•Reducevariancebyfindingadensityfunctionthatisclosetotherealfunctionp(x)=1b−ap(x)∝f(x)ImportanceSampling•Extremeexampleillustratinghowimportancesamplinghelpsp(x)∝f(x)p(x)=cf(x)c=1RΩf(u)duMustnormalizeprobability(somethingcannothappenmorethan100%ofthetime)OriginallyPresentedbyPharr&HumphreysImportanceSampling•Extremeexamplecontinued1NN∑i=1f(Xi)p(Xi)=f(Xi)cf(Xi)=1c=ZΩf(u)duPickingfromaDistribution•Chooserandomvalue,Xi,andsolveforx.ξ=Zx0p(u)du(WecallthisaCumulativeDistributionFunction)Multi-DimensionalMonteCarlo•AddintegralsontopofintegralsZΩn···ZΩ2ZΩ1f(u1,u2,...,un)du1du2...dunZΩf(u)duMulti-DimensionalMonteCarlo•Lookatmulti-dimensionalvariablesasavectorofvariables.Sametechniquesstillapplies!ZΩf(u)du=1NN∑if(Xi)p(Xi)VarianceReduction•MetropolisSampling•Simpleidea~SimilarintegralsshouldsharesamplesΨi=ZΩfi(u)duΨ1Ψ2...Ψ3ΨnMetropolisSampling•Histogramview•MovesamplesaroundforsimilarintegralsMetropolisSampling•Howdowesharesampleswithoutbiasing(un-randomizing)result?•WecreateageneralbalancebetweensamplesGeneralBalanceMaintainingBalance•TransferProbability•Mostdifficulttochoosetransferprobability•Aslongasgeneralbalanceisheldwithinthelimit,thefunctionissuitedforMetropolis•Wanttofindfunctionthatproducesthebestresult,withthefewestsamples.T(y→x)MetropolisSamplingAlgorithmchoosestartingsamplexfori=0tomutations y=mutate(x)acceptance=y/xT(y›x)/T(x›y) if(randomReal(0,1)acceptance) x=y depositsamplexendforNeatExamplechooserandomstartingpos(x,y)T(y›x)/T(x›y)=1fori=0tomutations npos=randompos acceptance=val[npos]/val[pos] if(randomReal(0,1)acceptance) pos=npos add1atposendforOriginallyPresentedbyCline&EgbertNeatExample•Equalprobabilityoftransfer•Formutationwejustchooseanotherpixel8mpp256mppNeatExample•Weseethatthemoresampleswetransferbetweentheintegrands(pixels)thecloserwecometotherealsolution•ShowsMSisunbiased,asinthelimit,itwillproperlydistributethesamplesacrosstheintegrandsPathTracingIi,j=ZALi(wo)dωoPixelLi(ωo)=Le+ZΩLi(ωi)f(ωi,ωo)cosθidωiPrimaryRaySecondaryRayRecursivedefinitionconsolidatedtofunctionoffinitedimension,gIi,j=ZAZΩ1ZΩ2...ZΩng(ωo,ωi1,ωi2,...,ωin)dωin...dωi2dωi1dωoConvertingPathstoMonteCarloIi,j=Zg(u)duIi,j=ZAZΩ1ZΩ2...ZΩng(ωo,ωi1,ωi2,...,ωin)dωin...dωi2dωi1dωoIi,j≈1NN∑i=1g(Xi)p(Xi)PathTracing•PDFsarechosenbasedupon:•MaterialProperties•ChoiceofLight•RussianRoulette•Pathlength(howmanyintegralsarewegoingtosolve)PathTracing•Initially,solveforcosineweightedBRDFdividebyprobabilityofsample•Whenconnectinglight,theprobabilityofanydirectionisuniform,butvariesdependinguponthedistancethepathmusttravel•DividebytheprobabilityofthelightandprobabilityofthelengthofthepathXf=f0(ωi0,ωo0)cosθi0p0(ωi0,ωo0)·f1(ωi1,ωo1)cosθi1p1(ωi1,ωo1)·...fn(ωin,ωon)cosθinπd2·V(xn,xlight)LeAplightplen(n)Results500samplesperpixelImprovementstoPathTracing•Pathperwavelengthoflight•Birefringence•Bi-directionalPathTracing•Startgeneratingapathfromboththeeyeandthelight•Connecttheminthemiddle•FurtherreducesvarianceMetropolisLightTransport•SurprisinglysimilartoMetropolisSampling•Now,thesamplesarepaths•HardPart•DeterminingTransferProbability•ChangesinPathDensity•MutationStrategyMutationandTransfer•Severalmutationstrategies•LensPerturbation*•CausticPerturbation•RandomPathMutation•ManyrulesforhowamutationchangesthepathdensityLensPerturbation•Takeapathandstartitinanewlocationontheimageplane•Withthenewlocationontheimageplane,wenowhaveachainreactionofmutationsChainMutation•Letswalkthroughthemutationofthefollowingpath•PathX:LDDSEspeculardiffusediffuselightspeculardiffusediffuselightLensPerturbationT(y→x)T(x→y)=1EqualprobabilitythatanewpixelischosenspeculardiffusediffuselightSpecular›(Specular|Diffuse)T(y→x)T(x→y)=1TravelinthesameincomingdirectionaspathxatspecularsurfacespeculardiffusediffuselightDiffuse›DiffuseIftwodiffusesurfaces,justconnectthepathsT(y→x)T(x→y)=cosθ1xcosθ2xd2xd2ycosθ1ycosθ2yspeculardiffusediffuselightRemainingConnectionsCopyremainingpath,possiblyperturbifdiffusevertexonpathT(y→x)T(x→y)=1PuttingitAllTogether•wejustwentovertransferprobabilitiesforpaths•yandxarerepresentedbyluminancevalueofsamplewhencalculatingacceptancestartwithrandompathxfori=0tomutations y=mutate(x)acceptance=y/xT(y›x)/T(x›y) if(randomReal(0,1)acceptance) x=y depositpathxatcorrespondingpixelendforUpScaling•Undeterminedamountofsamplesperpixel•ScaleupbyaveragenumberofsamplesperpixelResults200MCsamples500mutationsResults•Difficulttocompareinsheertermsofsamples•MutationsaremuchfasterthanMC•Pathreuse•Cachecoherence•Possiblespecularbug•Splotchiness?ProblemswithMLT•Start-upBias•Ifwejustmutateonerandomlygeneratedpath,inthelimit,wewilleventuallygetacorrectsolutionifweapplyseveralmutationstrategies•However,wedonotwanttobeclosetothelimit,wewanttobedonewithafewsamples•Thereby,wegenerateseveralrandompathsa
本文标题:Introduction to Metropolis Light Transport An Intu
链接地址:https://www.777doc.com/doc-6131188 .html