210 likes | 416 Views
Photon Tracing with Arbitrary Materials. Patrick Yau. Overview. Changes in Photon Map Changes in Photon Tracing Changes in Rendering. Caustic Photon Maps. Used only to store photons corresponding to caustics.
E N D
Photon Tracing with Arbitrary Materials Patrick Yau
Overview • Changes in Photon Map • Changes in Photon Tracing • Changes in Rendering
Caustic Photon Maps • Used only to store photons corresponding to caustics. • Created by emitting photons towards the specular objects in the scene and storing these as they hit diffuse surfaces. • Photons are highly focused into a small area.
Caustic Photon Maps (cont’d) • Separate into two photon maps because: • Render caustics is faster because it contains only photons related to caustics • Locating photons in global photon map is faster • Fewer photons • Improves accuracy of radiance estimate • Photons have energy levels that are more similar. • Caustics photons have high density and low energy • Normal photons have low density and high energy.
Photon Scattering • Specular reflection • Photons that hit specular surfaces are reflected in the mirror direction. • Calculated the same as specularly reflected rays in raytracing. • The power of the photon should be scaled by the reflectivity or the mirror. Unless using Russian Roulette.
Photon Scattering Diffuse reflection • Pick random direction in the hemisphere above the intersection point with a probability proportional to the cosine of the angle with the normal. • Photon map can be used as a heuristic for shadows.
Photon Scattering • Arbitrary BRDF Reflection • New photon direction is computed by importance sampling the BRDF. • If importance-sampling function is not available then pick a random direction. • e.g. Ward’s anisotropic model, Lafortune’s reflection model (previous lecture)
Photon Scattering • Russian Roulette: • Reflection or Absorption:
Photon Scattering • Russian Roulette: • Specular or Diffuse Reflection:
Photon Mapping: Rendering • The Direct Illumination term: • Computed by sending shadow rays towards all light sources to check for visibility • Two ways: approximate or accurate evaluation • Accurate: Use the global photon map to identify the fully illuminated or shadow areas in the scene avoiding the trace of shadow rays. • Approximate: evaluate the radiance directly from the photon maps. No need for tracing other rays.
Photon Mapping: Rendering • Classification of photons in Photon Map
Photon Mapping: Rendering • The specular term • Is computed using standard Monte Carlo ray tracing by using importance sampling based on the BRDF.
Photon Mapping: Rendering • The caustics term: • The radiance is estimated based on the caustics photon map. • It is visualized directly and this is the reason why the number of photons in the caustics photon map must be high.
Photon Mapping: Rendering • The soft indirect illumination term • The approximate evaluation of this integral is the radiance estimate based on the global photon map. • In the accurate evaluation we use importance sampling to compute the indirect illumination (combined with the diffuse BRDF part)
Photon Mapping: Rendering • Estimating Radiance using the Photon Map (for caustics and soft indirect illumination) • The information in the photon map can be used to compute the radiance leaving a surface in a given direction. Since the incoming direction is stored with each photon we can integrate the information with any BRDF. • To compute the radiance, Lr, leaving an intersection point x at a surface BRDF fr we locate the N photons with the shortest distance to x. • Based on the assumption that each photon p represented by ∆ΦpX arriving at X from direction Ψi,p we get:
Photon Mapping: Rendering • *Code taken from Taylor’s lecture. • Estimating Radiance • 1. radiance_estimate(x,v,n) { • 2. locate k nearest photons • 3. r = distance to kth nearest photon • 4. flux = 0 • 5. for each photon p { • 6. pd = direction of p • 7. phi = power of p • 8. flux += brdf(x, v, pd)*phi; • 9. } • 10. return flux/(2*pi*r^2) • 11. }
Another example = + Direct Illumination Indirect Illumination + = Specular Part
Another example (cont’d) + Caustics =
References • Henrik Wann Jensen: “Realistic Image Synthesis using Photon Maps”. • Henrik Wann Jensen: “Global Illumination using Photon Maps”. • Henrik Wann Jensen: “Rendering Caustics on Non Lambertian Surfaces”. • Michael Kaiser and Christian Finger: “Caustics Generation by using Photon Mapping” http://www.mpi-sb.mpg.de/units/nwg3/ws0304/lcn/projects/Michael/