Skip to content

Commit

Permalink
PostProcessingUtils: Add method for normal reconstruction. (#1348)
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 authored Nov 10, 2024
1 parent 4667272 commit 1d1f6cf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions types/three/src/nodes/utils/PostProcessingUtils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,18 @@ export const getScreenPosition: (
viewPosition: NodeRepresentation,
projectionMatrix: NodeRepresentation,
) => ShaderNodeObject<Node>;

/**
* 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<Node>;

0 comments on commit 1d1f6cf

Please sign in to comment.