Provides depth information of the video feed that the Lens is being applied to when available, such as in Lenses for Spectacles 3.
Can be accessed from mainPass.baseTex.control of a Spectacles Depth material.
// Get a reference to the Spectacles Depth material, set in the Inspector panel // @input Asset.Material depthMaterial
// Bind an event to run every frame script.createEvent("UpdateEvent").bind(function() { // The point at the center of the screen varscreenPosition = newvec2(0.5, 0.5);
// Get the depth at the screen position vardepth = script.depthMaterial.mainPass.baseTex.control.getDepth(screenPosition);
Provides depth information of the video feed that the Lens is being applied to when available, such as in Lenses for Spectacles 3. Can be accessed from
mainPass.baseTex.control
of a Spectacles Depth material.See the Lenses for Spectacles guide for more information.
Example