270 likes | 491 Views
Derek Nowrouzezahrai University of Toronto. Fast Soft Self-Shadowing on Dynamic Height Fields. John Snyder Microsoft Research. [Sloan&Cohen00]. Related Work. horizon mapping [Max88; …] hard shadows precomputed for static geometry. Related Work. shadow map filtering [Reeves87; …]
E N D
Derek Nowrouzezahrai University of Toronto Fast Soft Self-Shadowing on Dynamic Height Fields John Snyder Microsoft Research
[Sloan&Cohen00] Related Work • horizon mapping [Max88; …] • hard shadows • precomputed for static geometry
Related Work • shadow map filtering [Reeves87; …] • light “bleeding” artifacts • small light sources • no complex environmental lighting [Donnelly06]
Related Work • ambient occlusion [Bunnell05; Kontkanen05; …] • AO in screen-space [Shanmugam07;…] • “cone” blocker model [Heidrich00;…] [Dimitrov08] [Oat07]
Related Work [Sloan02; Ng04; …] • static relighting • dynamic relighting [Bunnell05, Ren06, Sloan07]
Goals • response to lighting direction (cast shadows) ambient occlusion low-frequency SH [Ren06]
Goals • response to lighting direction (cast shadows) • environmental + directional lighting
Goals • response to lighting direction (cast shadows) • environmental + directional lighting • dynamic geometry (not precomputed) • real-time performance • limitation: geometry is height field • applications: • terrain rendering (flight simulators, games, mapping/navigation) • data visualization
Summary of Main Ideas • approximate horizon map via multi-resolution • create height field pyramid [Burt81] • sample height differences from each pyramid level • use coarser levels as distance to receiver increases • greatly reduces sampling • convert horizon map to SH visibility for soft shadowing • use visibility wedges [Dimitrov08] • get good directional lighting response • sharpen shadows by restricting wedges azimuthally • fast: {2D lookup + SH z rotation + Σ over wedges}
Horizon Map [Max88] height field: z=f(x)=f(x,y), point: p(x) = (x,f(x)) horizon angle: (x,) max angle horizon makes at p in azimuthal direction Sample at all points xalong set of directions i.
Calculating the Horizon Map Problem: aliasing – need many samples in t. Solution: prefilter height field, apply multi-scale derivative.
+ j + j - æ ö f ( x t cos , y t sin ) f ( x , y ) - w j = 1 ç ÷ ( x , ) max tan t è ø Î ¥ t ( 0 , ) • Note: the horizon angle contains an expression similar to a numerical derivative of f Background = = z f ( x ) f ( x , y ) • Given a height field , the • maximum elevation angle of the horizon in the azimuthal direction, called the horizon angle, is
f ( x ) i Using a HF pyramid • We will use a multi-resolution pyramid in order to accelerate the computation of the horizon angle • pyramid level i denoted for • with resolution multipliers of • for k = 4 storage is approximately 3.4x the original HF
f ( x ) i Using a HF pyramid • We will use a multi-resolution pyramid in order to accelerate the computation of the horizon angle • pyramid level i denoted for • with resolution multipliers of • for k = 4 storage is approximately 3.4x the original HF • The pyramid will allow us to use an approximate sampling rate in directions and distance from receiver point • reduces sampling requirements of points far from the receiver while avoiding aliasing artifacts
+ j + j - f ( x d cos , y d sin ) f ( x , y ) j = i i i i D ( f , x , , d ) i i d i Multi-Scale Derivative • We introduce a multi-scale directional derivative, defined in terms of: • the pyramid scale • the receiver point • the azimuthal direction • and the distance to the receiver point • Sample heights from coarser pyramid levels as the distance from the receiver increases
( ) - w j = j 1 ( x , , d ) tan D ( f , x , , d ) i i i i i • convert the discrete “scale-space” horizon angles from step 1 to a continous function using b-spline interpolation w t j = t w j w j ( , x , ) b - spline ( , ( x , , d ),..., ( x , , d )) - - 0 0 1 1 N N Approximate Horizon Angle • To approximate the horizon angle given the multi-scale directional derivative we • obtain the horizon angle at each pyramid level
For strong directional lighting, b-spline pyramid synthesis as well as b-spline blocker angle interpolation are required to eliminate aliasing Approximate Horizon Angle 3. and take the max of the continuous function over all scales in the pyramid
Main Ideas • Approximating the horizon map • using a height field pyramid to avoid aliasing • in real-time for dynamic height field geometries • Use the horizon map to generate SH visibility • soft shadows using visibility “wedges” • fully directional lighting response • can sharpen shadows with restrictive wedges • FAST: {2D lookup + SH z rotation + Σ over wedges}
ò = L ( x , s ) L ( x , s ) f ( x , s , s ) v ( x , s ) cos( s ) ds q out in r out S Background • The rendering equation for direct illumination is
ò = L ( x , s ) L ( x , s ) f ( x , s , s ) v ( x , s ) cos( s ) ds q out in r out S ò ò = = L ( x ) L ( x , s ) h ( x , N ) v ( x , s ) ds L ( x , s ) T ( x ) ds in x in S S Background • The rendering equation for direct illumination is assume a diffuse BRDF and combine the reflectance and the cosine term
ò = L ( x , s ) L ( x , s ) f ( x , s , s ) v ( x , s ) cos( s ) ds q out in r out S ò ò = = L ( x ) L ( x , s ) h ( x , N ) v ( x , s ) ds L ( x , s ) T ( x ) ds in x in S S [ ] » × * = × L ( x ) L H ( N ) V L T x x x Background • The rendering equation for direct illumination is assume a diffuse BRDF and combine the reflectance and the cosine term project the lighting, clamped cosine weighted reflectance, and visibility into SH
Putting it all together • Height field geometry uniform grid of height values • Generated on the CPU or GPU • stored in a texture • A multi-resolution height pyramid is generated on-the-fly • avoid large sampling rates as distance from receiver point increases • Max blocking angles are determined • Fast LUT fast SH Z-rotation generate visibility At every step: • Re-generate height-field and pyramid • Determine total SH visibility over each azimuthal swath • Shade with SH triple product
Putting it all together • Height field geometry uniform grid of height values • Generated on the CPU or GPU • stored in a texture • A multi-resolution height pyramid is generated on-the-fly • avoid large sampling rates as distance from receiver point increases • Max blocking angles are determined • Fast LUT fast SH Z-rotation generate visibility At every step: • Re-generate height-field and pyramid • Determine total SH visibility over each azimuthal swath • Shade with SH triple product
Putting it all together • Height field geometry uniform grid of height values • Generated on the CPU or GPU • stored in a texture • A multi-resolution height pyramid is generated on-the-fly • avoid large sampling rates as distance from receiver point increases • Max blocking angles are determined • Fast LUT fast SH Z-rotation generate visibility At every step: • Re-generate height-field and pyramid • Determine total SH visibility over each azimuthal swath • Shade with SH triple product
Putting it all together • Height field geometry uniform grid of height values • Generated on the CPU or GPU • stored in a texture • A multi-resolution height pyramid is generated on-the-fly • avoid large sampling rates as distance from receiver point increases • Max blocking angles are determined • Fast LUT fast SH Z-rotation generate visibility At every step: • Re-generate height-field and pyramid • Determine total SH visibility over each azimuthal swath • Shade with SH triple product
Contributions • Aformulationof the maximum blocking angle as a directional derivative • We analyze the effects of pyramid depth, step size and filtering on the final shadow quality • Determining the visibility amounts to calculating amulti-scale directional derivative • We present an efficient algorithm for determining the visibility
Contributions • Aformulationof the maximum blocking angle as a directional derivative • We analyze the effects of pyramid depth, step size and filtering on the final shadow quality • Determining the visibility amounts to calculating amulti-scale directional derivative • We present an efficient algorithm for determining the visibility