From 7aea395ea3f572e435cdce042fc35074506a83e7 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Sun, 21 Jul 2024 23:41:43 -0400 Subject: [PATCH 1/2] Nodes: Add DenoiseNode. --- types/three/src/nodes/Nodes.d.ts | 1 + .../three/src/nodes/display/DenoiseNode.d.ts | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 types/three/src/nodes/display/DenoiseNode.d.ts diff --git a/types/three/src/nodes/Nodes.d.ts b/types/three/src/nodes/Nodes.d.ts index f753ea3a6..4ca311f08 100644 --- a/types/three/src/nodes/Nodes.d.ts +++ b/types/three/src/nodes/Nodes.d.ts @@ -313,6 +313,7 @@ export { linearTosRGB, sRGBToLinear, } from "./display/ColorSpaceNode.js"; +export { default as DenoiseNode, denoise } from "./display/DenoiseNode.js"; export { default as DepthOfFieldNode, dof } from "./display/DepthOfFieldNode.js"; export { default as DotScreenNode, dotScreen } from "./display/DotScreenNode.js"; export { default as FilmNode, film } from "./display/FilmNode.js"; diff --git a/types/three/src/nodes/display/DenoiseNode.d.ts b/types/three/src/nodes/display/DenoiseNode.d.ts new file mode 100644 index 000000000..8242d10c8 --- /dev/null +++ b/types/three/src/nodes/display/DenoiseNode.d.ts @@ -0,0 +1,38 @@ +import { Camera } from "../../cameras/Camera.js"; +import { Matrix4 } from "../../math/Matrix4"; +import Node from "../core/Node.js"; +import TempNode from "../core/TempNode.js"; +import UniformNode from "../core/UniformNode.js"; +import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js"; + +declare class DenoiseNode extends TempNode { + textureNode: Node; + depthNode: Node; + normalNode: Node; + noiseNode: Node; + + cameraProjectionMatrixInversion: UniformNode; + lumaPhi: UniformNode; + depthPhi: UniformNode; + normalPhi: UniformNode; + radius: UniformNode; + index: UniformNode; + + constructor(textureNode: Node, depthNode: Node, normalNode: Node, noiseNode: Node, camera: Camera); +} + +export const denoise: ( + node: NodeRepresentation, + depthNode: NodeRepresentation, + normalNode: NodeRepresentation, + noiseNode: NodeRepresentation, + camera: Camera, +) => ShaderNodeObject; + +declare module "../shadernode/ShaderNode.js" { + interface NodeElements { + denoise: typeof denoise; + } +} + +export default DenoiseNode; From 4561f8d34e4ee7d63baac508b2f5fb849f7a71c7 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Sun, 21 Jul 2024 23:43:32 -0400 Subject: [PATCH 2/2] Fix --- types/three/src/nodes/display/DenoiseNode.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/three/src/nodes/display/DenoiseNode.d.ts b/types/three/src/nodes/display/DenoiseNode.d.ts index 8242d10c8..8b5699dfa 100644 --- a/types/three/src/nodes/display/DenoiseNode.d.ts +++ b/types/three/src/nodes/display/DenoiseNode.d.ts @@ -1,5 +1,5 @@ import { Camera } from "../../cameras/Camera.js"; -import { Matrix4 } from "../../math/Matrix4"; +import { Matrix4 } from "../../math/Matrix4.js"; import Node from "../core/Node.js"; import TempNode from "../core/TempNode.js"; import UniformNode from "../core/UniformNode.js";