New version page

UT CS 395T - Monte Carlo I

Documents in this Course
TERRA

TERRA

23 pages

OpenCL

OpenCL

15 pages

Byzantine

Byzantine

32 pages

Load more

This preview shows page 1-2-15-16-31-32 out of 32 pages.

View Full Document
View Full Document

End of preview. Want to read all 32 pages?

Upload your study docs or become a GradeBuddy member to access this document.

View Full Document
Unformatted text preview:

Monte Carlo ILighting and Soft ShadowsPenumbras and UmbrasMonte Carlo LightingMonte Carlo AlgorithmsRandom VariablesDiscrete Probability DistributionsContinuous Probability DistributionsSampling Continuous DistributionsExample: Power FunctionSampling a CircleSlide 12Rejection MethodsSampling a Circle: RejectionMonte Carlo IntegrationOver Arbitrary DomainsNon-Uniform DistributionsUnbiased EstimatorDirect Lighting – Directional SamplingDirect Lighting – Area SamplingExamplesSlide 22Slide 23Slide 24Slide 25VarianceSlide 27Sampling Projected Solid AngleSlide 29Variance ReductionSampling a TriangleSlide 32CS348B Lecture 6 Pat Hanrahan, Spring 2005Monte Carlo IPrevious lectureAnalytical illumination formulaThis lectureNumerical evaluation of illuminationReview random variables and probabilityMonte Carlo integration Sampling from distributionsSampling from shapesVariance and efficiencyCS348B Lecture 6 Pat Hanrahan, Spring 2005Lighting and Soft ShadowsChallenges Visibility and blockers Varying light distribution Complex source geometry2( ) ( , )cosiHE x L x dw q w=�Source: Agrawala. Ramamoorthi, Heirich, Moll, 2000CS348B Lecture 6 Pat Hanrahan, Spring 2005Penumbras and UmbrasCS348B Lecture 6 Pat Hanrahan, Spring 2005Monte Carlo Lighting1 eye ray per pixel1 shadow ray per eye rayFixed RandomCS348B Lecture 6 Pat Hanrahan, Spring 2005Monte Carlo AlgorithmsAdvantagesEasy to implementEasy to think about (but be careful of statistical bias)Robust when used with complex integrands and domains (shapes, lights, …)Efficient for high dimensional integralsEfficient solution method for a few selected pointsDisadvantagesNoisySlow (many samples needed for convergence)CS348B Lecture 6 Pat Hanrahan, Spring 2005Random Variables is chosen by some random process probability distribution (density) functionX~ ( )X p xCS348B Lecture 6 Pat Hanrahan, Spring 2005Discrete Probability DistributionsDiscrete events Xi with probability piCumulative PDF (distribution)Construction of samples To randomly select an event, Select Xi if0ip �11niip==�1i iP U P-< �ip1jj iiP p==�U10Uniform random variable3XiPCS348B Lecture 6 Pat Hanrahan, Spring 2005Continuous Probability DistributionsPDF CDF10( ) Pr( )P x X x= <Pr( ) ( )( ) ( )X p x dxP Pbaa bb a� � == -�( )p x10Uniform( ) 0p x �0( ) ( )xP x p x dx=�(1) 1P =( )P xCS348B Lecture 6 Pat Hanrahan, Spring 2005Sampling Continuous DistributionsCumulative probability distribution function Construction of samplesSolve for X=P-1(U)Must know:1. The integral of p(x)2. The inverse function P-1(x)UX10( ) Pr( )P x X x= <CS348B Lecture 6 Pat Hanrahan, Spring 2005Example: Power FunctionAssume( ) ( 1)np x n x= +1110011 1nnxx dxn n+= =+ +�1( )nP x x+=11~ ( ) ( )nX p x X P U U-+� = =1 2 1max( , , , , )n nY U U U U+= L111Pr( ) Pr( )nniY x U x x++=< = < =�TrickCS348B Lecture 6 Pat Hanrahan, Spring 2005Sampling a Circle12 1 1 22200 0 0 002rA r dr d r dr dp ppq q q p� �= = = =� �� ��� � �( , ) ( ) ( )p r p r pq q=2( ) 2( )p r rP r r==12 Uq p=rdqdr1( )21( )2pPqpq qp==1( , ) ( , )rp r dr d r dr d p rq q q qp p= � =2r U=CS348B Lecture 6 Pat Hanrahan, Spring 2005Sampling a Circle122 Ur Uq p==122 Ur Uq p==RIGHT  Equi-ArealWRONG  Equi-ArealCS348B Lecture 6 Pat Hanrahan, Spring 2005Rejection MethodsAlgorithmPick U1 and U2Accept U1 if U2 < f(U1)Wasteful? 10( )( )y f xI f x dxdx dy<==���( )y f x=Efficiency = Area / Area of rectangleCS348B Lecture 6 Pat Hanrahan, Spring 2005Sampling a Circle: RejectionMay be used to pick random 2D directionsCircle techniques may also be applied to the spheredo {X=1-2*U1Y=1-2*U2while( X2+ Y2 >1 )CS348B Lecture 6 Pat Hanrahan, Spring 2005Monte Carlo IntegrationDefinite integralExpectation of fRandom variablesEstimator10( ) ( )I f f x dx��10[ ] ( ) ( )E f f x p x dx��~ ( )iX p x( )i iY f X=11NN iiF YN==�CS348B Lecture 6 Pat Hanrahan, Spring 2005Over Arbitrary DomainsbadxxfI )(abxpUba1)(11)()( babaabxpxPbadxxpxfabI )()()()()( fEabI badxxpxfIE )()()(fabI )( )(1)(1iNiXfNabIabab 1CS348B Lecture 6 Pat Hanrahan, Spring 2005Non-Uniform DistributionsbadxxfI )(badxxpxpxfI )()()()()()(xpxfxg badxxpxgI )()()(gEI NiiXgNI1)(1CS348B Lecture 6 Pat Hanrahan, Spring 2005Unbiased Estimator11 1110110101[ ] [ ]1 1[ ] [ ( )]1( ) ( )1( )( )NN iiN Ni ii iNiNiE F E YNE Y E f XN Nf x p x dxNf x dxNf x dx== ===== ====�� ������[ ] ( )NE F I f=Assume uniform probability distribution for now[ ] [ ]i ii iE Y E Y=� �[ ] [ ]E aY aE Y=PropertiesCS348B Lecture 6 Pat Hanrahan, Spring 2005Direct Lighting – Directional Sampling2( ) ( , ) cosHE x L x dw q w=�*( ( , ), ) cos 2i i i iY L x x w w q p= -*( , )x x wRay intersectionA�w*xxqSample uniformly byWwCS348B Lecture 6 Pat Hanrahan, Spring 2005Direct Lighting – Area Sampling22cos cos( ) ( , ) cos ( , ) ( , )oAHE x L x d L x V x x dAx xq qw q w w��� � � �= =�-� �2cos cos( , ) ( , )i ii o i i iiY L x V x x Ax xq qw�� � �=�-A�w�x�xqx xw� �= -Ray directionSample uniformly byA�x�0( , )1visibleV x xvisible���=��q�CS348B Lecture 6 Pat Hanrahan, Spring 2005Examples4 eye rays per pixel1 shadow ray per eye rayFixed RandomCS348B Lecture 6 Pat Hanrahan, Spring 2005Examples4 eye rays per pixel16 shadow rays per eye rayUniform grid Stratified randomCS348B Lecture 6 Pat Hanrahan, Spring 2005Examples4 eye rays per pixel64 shadow rays per eye rayUniform grid Stratified randomCS348B Lecture 6 Pat Hanrahan, Spring 2005Examples4 eye rays per pixel100 shadow rays per eye rayUniform grid Stratified randomCS348B Lecture 6 Pat Hanrahan, Spring 2005Examples4 eye rays per pixel16 shadow rays per eye ray64 eye rays per pixel1 shadow ray per eye rayCS348B Lecture 6 Pat Hanrahan, Spring 2005VarianceDefinitionPropertiesVariance decreases with sample size22 22 2[ ] [( [ ]) ][ 2 [ ] [ ] ][ ] [ ]V Y E Y E YE Y YE Y E YE Y E Y� -= - += -[ ] [ ]i ii iV Y V Y=� �2[ ] [ ]V aY a V Y=21 11 1 1[ ] [ ] [ ]N Ni ii iV Y V Y V YN N N= == =� �CS348B Lecture 6 Pat Hanrahan, Spring 2005Direct Lighting – Directional Sampling2( ) ( , ) cosHE x L x dw q w=�*( ( , ), ) cos 2i i i iY L x x w w q p= -*( ( , ), )i i iY L x x w w p= -*( , )x x wRay intersectionA�w*xxqSample uniformly byWwSample uniformly byW%wCS348B Lecture 6 Pat Hanrahan, Spring 2005Sampling Projected Solid


View Full Document
Loading Unlocking...
Login

Join to view Monte Carlo I and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Monte Carlo I and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?