Develop
Develop
Select your platform

Depth API Material Graph

Updated: Sep 4, 2024
For use cases other than occlusions, you can access the depth texture via the material graph. Use the Environment Depth expression to sample the depth texture. Depth is returned in world units (centimeters by default). It works in the same way as the SceneDepth.
Use the Environment Depth expression to sample the depth texture. Depth is returned in world units (centimeters by default).
Note: You need the Oculus-VR fork of the Unreal Engine for this feature.
This opens up the door for other interesting use cases other than occlusion.

Example use cases

First example gets the environment depth and maps it to the Hue of a color, thus making it change based on distance.
Environment Depth hue example.
Second example gets the environment depth and scene depth and compares the distance. If the environment is further it renders red otherwise it renders blue.
Environment Depth distance cutoff.
Did you find this page helpful?