depthToSurface
DepthToSurface refers to a technique used in computer graphics to convert a value from a depth buffer into a 3D point on the corresponding surface along the camera ray. It enables reconstruction of a surface or scene geometry from depth data, which can then be used for shading, lighting, or post-processing effects.
The core idea is to take the per-pixel depth and the pixel’s screen coordinates and recover the
Implementations require information about the camera, including its projection parameters or matrices, the viewport size, and
Applications of depthToSurface include screen-space effects such as ambient occlusion, reflections, and depth-based shading, as well