ambient occlusion - nvidia...what do point lights and reflection maps have in common? • point or...
TRANSCRIPT
![Page 1: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/1.jpg)
Ambient OcclusionAmbient Occlusion
Matt PharrNVIDIA
![Page 2: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/2.jpg)
Diffuse Shading
![Page 3: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/3.jpg)
Diffuse + Ambient Occlusion
![Page 4: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/4.jpg)
Diffuse + Ambient Occlusion + Environment Lighting
![Page 5: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/5.jpg)
Overview
• Light scattering from surfaces• Main Idea:
– Use occlusion to modulate lighting• Implementation details• Demo• Further resources
![Page 6: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/6.jpg)
What do point lights and reflection maps have in common?
• Point or distant lights– Sum over light from single directions
• Environment maps– Add light from single reflected/transmitted
direction• Both are discrete: ignore continuous
directional variation of illumination
![Page 7: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/7.jpg)
Problems with These Simplifications
• Hard shadows• Perfect, unblurred, reflections• “Stark” lighting
![Page 8: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/8.jpg)
Introducing Directional Variation
• Ambient occlusion• Irradiance maps• Blurred environment maps• Soft shadows (smoothies, etc.)• Spherical harmonic lighting
![Page 9: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/9.jpg)
The Basic IdeaCompute fraction of visible hemisphere and average unoccluded direction at P
![Page 10: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/10.jpg)
Cone of Unoccluded Directions Approximation
![Page 11: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/11.jpg)
Computing Occlusion Values
generate rays over hemisphereocclusion = 0avgDir = (0,0,0)foreach ray {
if ray doesn’t intersect modelavgDir += ray.dir
else ++occlusion;}occlusion /= nRaysnormalize(avgDir)
Ray-tracing pre-process
![Page 12: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/12.jpg)
Computing Occlusion Values
• Multi-pass rendering in hardware with shadow maps– See article for details
![Page 13: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/13.jpg)
GPU-Generated Occlusion Maps(4 samples)
![Page 14: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/14.jpg)
GPU-Generated Occlusion Maps(32 samples)
![Page 15: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/15.jpg)
GPU-Generated Occlusion Maps(128 samples)
![Page 16: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/16.jpg)
GPU-Generated Occlusion Maps(512 samples), ~4 seconds
![Page 17: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/17.jpg)
Using Occlusion Values I
• Simple blurred env map lookuphalf4 main(half3 avgDir,
half occlusion,half3 Kd) : COLOR {
half blur = 1 – occlusion; //ad-hocreturn Kd * (1-occlusion) *texCube(envMap, avgDir, blur);
}
![Page 18: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/18.jpg)
Using Occlusion Values II
• Modulate irradiance map lookuphalf4 main(samplerCUBE irradMap,
half3 Kd, half occlusion,half3 N) : COLOR {
return Kd * (1-occlusion) *texCUBE(irradMap, N);
}
![Page 19: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/19.jpg)
Demo
![Page 20: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/20.jpg)
Animated OcclusionOgre Demo
![Page 21: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/21.jpg)
Summary
• AO helps reduce the stark “CG” look– Medium expensive precomputation– Fast rendering
• Special case of some spherical harmonic approaches
![Page 22: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/22.jpg)
Further Reading
• S. Zhukov, A. Iones, G. Kronin, An Ambient Light Illumination Model, proc. Eurographics Rendering Workshop '98
• Hayden Landis, Production-Ready Global Illumination, “RenderMan in Production” SIGGRAPH Course Notes, 2002
![Page 23: Ambient Occlusion - Nvidia...What do point lights and reflection maps have in common? • Point or distant lights – Sum over light from single directions • Environment maps –](https://reader033.vdocuments.us/reader033/viewer/2022041615/5e3ae901f2d97557757befe6/html5/thumbnails/23.jpg)
Further Resources
• GPU Gems• FX Composer
– developer.nvidia.com/fxcomposer
• NVIDIA SDK Version 7– Ambient occlusion demo