Photon Tracing Photon Maps � Simulating light propagation by shooting photons from the light sources. Photon Tracing Photon Tracing � Storing the � Photon maps keep: incidences of � Incidence point photon ’ s path. (in 3D). � Implementing � The normal at surface properties that point. statistically. � Incidence � Russian Roulette. direction. � Photons power. Photon Map Russian Rolette � D – diffuse coefficient � S – specular coefficient � D + S <= 1 � Choose random number x [0,1] � 0<= x <= D – diffuse reflection � D < x <= S – specular reflection � S < x <= 1 – absobrtion 1
Estimating Radiance Estimating Radiance � The reflected radiance is given by: � Solution: � � � � � � � ∫ � Look at a circle = L ( x , w ) f ( w , w ' , w ) L ( x , w ' )( n , w ' ) d w ' i x around x with Ω Φ � � � ( A ) radius r. = L ( x , w ' )( n , w ' ) i i x dA � Add only photons ∆Φ from that are � � � ∑ ≈ p L ( x , w ) f ( x , w ' , w ) p ∆ � dA = pi * r A p � Or weighted sum � The last term has dA while we are tracing (Gaussian kernel) single photons and not fluxes. Building Photon Maps Producing the Image � Use ray tracing to determine the visible points � Caustic Maps: Cast rays from light source toward specular objects � Radiance at a point is broken into several � Bias the sampling with “ projection maps ” that suggest good components: places to send rays � One-bounce light from sources � Stop when the ray hits a diffuse surface, and store the point, � Light reflected specularly from other points direction, intensity � When all the rays have been cast, build a kd-tree on the � Diffusely reflected caustics points � Light reflected diffusely multiple times � Only need tree for later look-up, so worth building a good tree � Each component is determined separately � Global Photon Map: Monte-Carlo Path tracing from � Accurate method for directly seen light and “ difficult ” lights geometry � Deposit a photon at every surface hit � Approximate for diffusely reflected light (low weight) � Use Russian Roulette to control cost and reduce bias Computing Contributions The “ 2 pass ” algorithm � Direct illumination: � Step I: � Accurate: Photon map gives approx. shadow, cast ray if not � Building photon maps. certain � Contains: direct,indirect,caustics photons. � Approximate: Use diffuse photon map directly � Specular reflection: � Step II: � Distribution ray tracing with importance � Rendering the scene using ray tracing. � Caustics: � Direct lighting – sending rays to light sources. � Use caustics photon map directly � Specular – sending rays towards reflected direction. � Soft indirect illumination: � Caustics – from PM. � Accurate: “ Radiance ” style estimate � Indirect – from PM. � Approximate: Global photon map 2
“ 2 pass ” Algorithm Direct visualization of PM Cornell box (PM): 2560x1920, 51 minutes Cornell box (Rad): 5120x3840, 360 minutes 3
4
Recommend
More recommend