260 likes | 443 Views
Derek Nowrouzezahrai University of Toronto. Fast Self-Shadowing on Dynamic Height Fields. John Snyder Microsoft Research. [Sloan&Cohen00]. Related Work. [Max88; Stewart98; Sloan&Cohen00]. horizon mapping hard shadows precomputed for static geometry. Related Work.
E N D
Derek Nowrouzezahrai University of Toronto Fast Self-Shadowing on Dynamic Height Fields John Snyder Microsoft Research
[Sloan&Cohen00] Related Work [Max88; Stewart98; Sloan&Cohen00] • horizon mapping • hard shadows • precomputed for static geometry
Related Work [Reeves87; Donnelly06; …] • shadow map filtering • light “bleeding” artifacts • small light sources • no complex environmental lighting [Donnelly06]
Related Work [Bunnell05; Kontkanen05; …] • ambient occlusion • AO in screen-space • “cone” blocker model [Shanmugam07; Dimitrov08] [Dimitrov08] [Heidrich00; Oat07] [Oat07]
Related Work [Sloan02; Ng04; …] • static relighting • dynamic relighting [Bunnell05, Zhang06, 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: restrict geometry to height field
Summary of Main Ideas • approximate the horizon map via multi-res • avoid aliasing with height field pyramid • sample height differences from each pyramid level • use coarser levels as caster-to-receiver dist. increases • real-time for dynamic height fields • use the horizon map to generate SH visibility • soft shadows using visibility wedges • fully directional lighting response • sharpen shadows with restrictive wedges • fast: {2D lookup + SH z rotation + Σ over wedges} [Dimitrov08]
Horizon Map height field: z=f(x)=f(x,y), p=(x,f(x)) horizon angle: (x,) max angle horizon makes at p in azimuthal direction sample at all points x, along set of directions i
+ 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