MixedReality-GraphicsTools-Unity icon indicating copy to clipboard operation
MixedReality-GraphicsTools-Unity copied to clipboard

Vertex ambient occlusion tool

Open pinkwerks opened this issue 3 years ago • 2 comments

Overview

Adds a tool that calculates "ambient occlusion" and stores the data in the mesh for use in the Standard shader.

image image

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 may be expensive, and not well suited for mobile, VR, or other "low end" platforms. Baking global illumination to textures can cumbersome and relies on well-formed UVs (when not using lightmaps).

As an alternative, this tool will bake occlusion information into the mesh vertices. The Graphics Tools Standard shader then uses this information to integrate the lighting.

Notes

  • The quality of the AO solution is very dependent on the vertex count and normals of the mesh. You can see these artifacts as dark triangular shadows near the basses of the shader-ball, pictured above.
  • Editor UI built with UI Toolkit using UXML and USS, backed by ScriptableObject settings
  • Additional updates to StandardShaderGUI.cs to support material conversions that use GLTF material semantics (Piglet)
  • README.md in Packages/com.microsoft.mrtk.graphicstools.unity/Editor/Experimental/AmbientOcclusion/README.md

pinkwerks avatar Sep 29 '22 01:09 pinkwerks

Would it be possible to make a small sample scene, just to verify that functionally doesn't regress in future updates to GT? You can see simple sample scenes for experimental features here.

Cameron-Micka avatar Sep 30 '22 18:09 Cameron-Micka

Would it be possible to make a small sample scene, just to verify that functionally doesn't regress in future updates to GT? You can see simple sample scenes for experimental features here.

Done

pinkwerks avatar Oct 04 '22 21:10 pinkwerks