indire c t diffuse and glossy illumination on the gpu
DESCRIPTION
Indire c t Diffuse and Glossy Illumination on the GPU. István Lazányi László Szirmay-Kalos TU Budapest. Environment mapping. for ideal reflections. [Blinn & Newel, 1976]. Environment map = Fast approximation of environmental effects. Environment mapping. for ideal reflections. (original). - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/1.jpg)
IndireIndirecct Diffuse and Glossy t Diffuse and Glossy Illumination on the GPUIllumination on the GPU
István Lazányi László Szirmay-Kalos
TU Budapest
![Page 2: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/2.jpg)
Environment mappingfor ideal reflections
[Blinn & Newel, 1976]
Environment map = Fast approximation of environmental effects
![Page 3: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/3.jpg)
If the environment is very (or infinitely) far…
skybox
Environment mappingfor ideal reflections
(enlarged)
(original)
![Page 4: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/4.jpg)
re-render environment map from the new reference
point
If the environment is "close"…
performance ?!
Environment mappingfor ideal reflections
![Page 5: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/5.jpg)
Note: (classic) environment mapping cannot deal with "large" objects
[Approximate Ray-Tracing…, Eurographics 2005]
ray-traced
Environment mappingfor ideal reflections
storing depth information
in the environment map
![Page 6: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/6.jpg)
Ideal reflection vs. indirect illumination:
Adding cosine-weighted contributions:
Environment mappingfor diffuse & glossy reflections - classical
many sampling rays
are necessary!
= convolution
Offline convolution:
preconvolved diffuse/specular map
![Page 7: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/7.jpg)
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 mappingfor diffuse & glossy reflections – our proposal
2. Evaluate the convolution integral on the fly
![Page 8: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/8.jpg)
Environment mappingfor diffuse & glossy reflections – our proposal
solid angles Δωi can easily be calculated
(no information is necessary about the environment! )
For the reference point:
![Page 9: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/9.jpg)
cosine value is approx. the same
as in the reference point
Environment mappingfor 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
![Page 10: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/10.jpg)
Thus, localization means multiplying solid angle with a factor for each texel
precalculation of the convolution integral is not possible
Environment mappingfor diffuse & glossy reflections – our proposal
How about the bunny …?
?
![Page 11: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/11.jpg)
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 mappingfor diffuse & glossy reflections – our proposal
![Page 12: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/12.jpg)
Results(Diffuse bunny)
classical our proposal (75FPS @ 2x2, 20FPS @ 4x4)
![Page 13: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/13.jpg)
Results(Glossy bunny, s=10)
classical our proposal
![Page 14: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/14.jpg)
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 * r2 / 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;
![Page 15: Indire c t Diffuse and Glossy Illumination on the GPU](https://reader036.vdocument.in/reader036/viewer/2022081501/56813bfb550346895da548b1/html5/thumbnails/15.jpg)
Question time!