MixedReality-GraphicsTools-Unity
MixedReality-GraphicsTools-Unity copied to clipboard
User/pinkb/ambient occlusion
Overview
Adds an "ambient occlusion" component that modifies a mesh to include ambient occlusion data for use by the Standard Shader


Motivation
Ambient occlusion adds realism to a scene by providing important clues to viewers about an object's relationship to other objects. However, as a post-process it is expensive and not well suited for VR and low-end platforms. Baking global illumination to textures can cumbersome and relies on sane UVs (when not using lightmaps).
As an alternative, we bake this occlusion information into the mesh vertices, which is evaluated per vertex and passed to fragment shader as part of rasterization.
Notes
- Additional updates to
StandardShaderGUI.csto support material conversions that use GLTF material semantics - The fidelity of the AO solution is very dependent on the vertex count and normals of the mesh.
This is super cool and useful. Thank you for the contribution! Added some minor comments below.
I also tried it out locally and saw AO generated as expected (circled in blue) but also saw some vertices appear to get brighter (circled in green). Is this expected?
Thanks for the review and comments! The "brighter" vertex was un-occluded due to ray casts not considering back faces. This has been fixed.
Just checking in to see if this is ready for a re-review?
I'm going to refactor this into a standalone window, and not a component. Will re-open a fresh PR when that is ready.
