Presentation is loading. Please wait.

Presentation is loading. Please wait.

Indirect Diffuse and Glossy Illumination on the GPU István Lazányi László Szirmay-Kalos TU Budapest.

Similar presentations


Presentation on theme: "Indirect Diffuse and Glossy Illumination on the GPU István Lazányi László Szirmay-Kalos TU Budapest."— Presentation transcript:

1 Indirect Diffuse and Glossy Illumination on the GPU István Lazányi László Szirmay-Kalos TU Budapest

2 Environment mapping for ideal reflections [Blinn & Newel, 1976] Environment map = Fast approximation of environmental effects

3 If the environment is very (or infinitely) far…  skybox Environment mapping for ideal reflections (enlarged) (original)

4 re-render environment map from the new reference point  If the environment is "close"… performance ?! Environment mapping for ideal reflections

5 Note: (classic) environment mapping cannot deal with "large" objects [Approximate Ray-Tracing…, Eurographics 2005] ray-traced Environment mapping for ideal reflections  storing depth information in the environment map

6 Ideal reflection vs. indirect illumination: Adding cosine-weighted contributions: Environment mapping for diffuse & glossy reflections - classical many sampling rays are necessary! = convolution Offline convolution:  preconvolved diffuse/specular map

7 1.Take an environment map (with depth info. in the alpha channel) where Δω i (i=1..N) corresponds to the texels of the environment map ω i = ? from a point x Environment mapping for diffuse & glossy reflections – our proposal 2. Evaluate the convolution integral on the fly

8 Environment mapping for diffuse & glossy reflections – our proposal solid angles Δω i can easily be calculated (no information is necessary about the environment! ) For the reference point:

9  cosine value is approx. the same as in the reference point Environment mapping for diffuse & glossy reflections – our proposal distance r’ is known  but cosθ’ is unknown For an arbitrary point x : to calculate solid angle Δω i Instead of storing orientation information about the environment, assume that the movement is small

10 Thus, localization means multiplying solid angle with a factor for each texel  precalculation of the convolution integral is not possible Environment mapping for diffuse & glossy reflections – our proposal How about the bunny …? ?

11 To allow real-time calculation the environment map is downsampled by averaging neighboring texels. (e.g. 128 x 128  4 x 4) ≈ clustering the texels of the environment into larger area lights Environment mapping for diffuse & glossy reflections – our proposal

12 Results (Diffuse bunny) classicalour proposal (75FPS @ 2x2, 20FPS @ 4x4)

13 Results (Glossy bunny, s=10) classicalour proposal

14 Implementation float4 Lin = texCUBE(LREnvMap, I) ; float r = texCUBE(LREnvMap, I).a ; float3 L = r * I – pos ; float r’ = length(L); float dw = dw_texel * r 2 / r’ 2 //Illumination formula for N,V,L L = L / |L|; float a = kd * max(dot(N, L), 0) (or texture lookup) return Lin * a * dw;

15 Question time!


Download ppt "Indirect Diffuse and Glossy Illumination on the GPU István Lazányi László Szirmay-Kalos TU Budapest."

Similar presentations


Ads by Google