Realistic Image Synthesis - BRDFs and Direct ighting - Philipp Slusalle Karol Myszowsi Gurprit Singh Realistic Image Synthesis SS8 BRDFs and Direct ighting
Importance Sampling Example Example: Generate Cosine weighted distribution Generate ray according to cosine distribution with respect to normal eed only average of the incident radiance Realistic Image Synthesis SS8 BRDFs and Direct ighting
Multidimensional Inversion Multidimensional Inversion Method (here D Goal: density function p(x, y with x a, b, y [c, d] Compute cumulative distribution function P x, y න න p x, y dx dy Realistic Image Synthesis SS8 BRDFs and Direct ighting c y a x Random variables along x are generated by integrating P over entire y-range (marginal density ξ P ξ, y ቚ yd P ξ ξ P (ξ ow, given x ξ we have a one-dimensional problem but we still need to normalize ξ ~ P x, ξ ቚ xξ P ξ ξ ~ P ξ ξ P (ξ P(d
Multidim. Inversion: Hemisphere Multidimensional probability function (p ω const c න Ω + p ω dω c න Ω + dω c π p ω π p θ, φ sin(θ π with dω sinθ dθdφ Marginal density function (integrating out φ π sinθ p θ න 0 π dφ sinθ ξ Conditional density function p φ θ p(θ, φ p(θ π P θ න 0 θ ξ P φ θ න sinθ dθ cosθ 0 φ π dφ φ π Inverting, with: if ( X is uniform in [0, ], so is X θ cos ξ cos ξ φ πξ Realistic Image Synthesis SS8 BRDFs and Direct ighting
Sampling a BRDF Uniformly distributed on the hemisphere (~dω x cos( ( y sin( ( acos( z Cosine distributed on the hemisphere (~cosθdω x cos( ( y sin( ( acos( z Cosine-power distributed on the hemisphere (~cos n θdω n acos( n+ n+ Realistic Image Synthesis SS8 BRDFs and Direct ighting x cos( ( + y sin( z ( n+ Also see Global Illumination Compentium by Philip Dutre (U. euven: http://www.cs.uleuven.ac.be/~phil/gi/
Realistic Image Synthesis SS8 BRDFs and Direct ighting Sampling a BRDF Phong BRDF Sampling the diffuse part Uniform on the hemisphere Better: Cosine distributed Sampling the glossy part Uniform on the hemisphere Better: Cosine distributed Cosine-power distributed Cdigon integrates only over positive hemisphere (see GI-Compendium d d d x f n i s i d i o i r cos cos cos cos,, ( + + + + d d I I ( cos ( s n s n s C I I I cos ( cos ( cos cos ( digon θ' θ
Direct ighting Computation eed to compute the integral See also Shirley et al.: MC-Techniques for Direct ighting Calculations Single light source, not too close (>/5 of its radius Small: /r has low variance, cosθ x has low variance Planar: cosθ y has low variance too Choose samples uniformly on light source geometry Sampling directions could have high variance For curved light sources Tae into account orientation/normal Realistic Image Synthesis SS8 BRDFs and Direct ighting
Direct ighting Computation Sampling projected solid angle 00 shadow rays Sampling light source area 00 shadow rays Realistic Image Synthesis SS8 BRDFs and Direct ighting
Direct ighting Computation Fixed sample location shadow ray each Random sample location shadow ray each Realistic Image Synthesis SS8 BRDFs and Direct ighting
Direct ighting Computation Sample locations on D grid 64 shadow ray Stratified random sample locations 64 shadow ray Realistic Image Synthesis SS8 BRDFs and Direct ighting
Direct ighting Computation Stratified random sample locations 6 shadow ray Stratified random sample locations 6 shadow ray Realistic Image Synthesis SS8 BRDFs and Direct ighting
Direct ighting Computation Importance sampling of many light sources Ray tracing cost grows with number of lights Approaches Equal probability (/ Fixed weights according to total power of light Sample as discrete probability density function Mae sure that pdf is not zero if light could be visible Must use conservative approximation Stratification through spatial subdivision Estimate the contribution of lights in each cell (e.g. octree Dynamic and adaptive importance sampling Compute a running average of irradiance at nearby points Use the relative contribution as the importance function Should use coherent sampling Might need to estimate separately for primary and secondary rays p i i i Realistic Image Synthesis SS8 BRDFs and Direct ighting
Direct ighting Computation Example: Sampling thousands of lights interactively At each pixel send random path into the scene & towards some light ow overhead since we already trace many rays per pixel Gives a rough estimate of light contribution to the entire image Tae maximum contribution of each light at any pixel Might want to average over several images (less variance Use this estimate for importance sampling Mae sure every light is sampled eventually Might ignore lights with very low probability (but introduces bias Trace samples OY from the eye Avoids touching the entire scene Minimizes woring set for very large scenes Published as [Wald et al., Interactive Global Illumination in Complex and Highly Occluded Environments, EGSR 03] Realistic Image Synthesis SS8 BRDFs and Direct ighting