Sample output textures in a shader
Read the data from a depth texture or a motion vector texture in custom shader code.
Read time 1 minuteLast updated 10 days ago
Depth textures are available for sampling in shaders as global shader properties. By declaring a sampler called you will be able to sample the main depth texture for the camera.
_CameraDepthTexture_CameraDepthTexture_LastCameraDepthTextureIn the Built-In Render Pipeline, the motion vectors texture (when enabled) is available in Shaders as a global Shader property. By declaring a sampler called '_CameraMotionVectorsTexture' you can sample the Texture for the currently rendering Camera. When sampling from this texture motion from the encoded pixel is returned in a range of -1..1. This will be the UV offset from the last frame to the current frame.