diff --git a/types/three/src/nodes/utils/PostProcessingUtils.d.ts b/types/three/src/nodes/utils/PostProcessingUtils.d.ts index f1d5d5012..0406e4d77 100644 --- a/types/three/src/nodes/utils/PostProcessingUtils.d.ts +++ b/types/three/src/nodes/utils/PostProcessingUtils.d.ts @@ -28,3 +28,18 @@ export const getScreenPosition: ( viewPosition: NodeRepresentation, projectionMatrix: NodeRepresentation, ) => ShaderNodeObject; + +/** + * Computes a normal vector based on depth data. Can be used as a fallback when no normal render target is available or + * if flat surface normals are required. + * + * @param {vec2} uv - The texture coordinate. + * @param {DepthTexture} depthTexture - The depth texture. + * @param {mat4} projectionMatrixInverse - The camera's inverse projection matrix. + * @return {vec3} The computed normal vector. + */ +export const getNormalFromDepth: ( + uv: NodeRepresentation, + depthTexture: NodeRepresentation, + projectionMatrixInverse: NodeRepresentation, +) => ShaderNodeObject;