Skip to content

Commit

Permalink
Node: Add SobelOperatorNode. (#1056)
Browse files Browse the repository at this point in the history
* Node: Add SobelOperatorNode.

* Update three.js

* Add examples

* Update patch

* Delete examples

* Fix import
  • Loading branch information
Methuselah96 authored Jun 26, 2024
1 parent 5dd05ca commit 842b6f5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
15 changes: 15 additions & 0 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14255,6 +14255,21 @@ index b89f2921..c3cfcdfe 100644

postProcessing.outputNode = combinedPass;

diff --git a/examples-testing/examples/webgpu_postprocessing_sobel.ts b/examples-testing/examples/webgpu_postprocessing_sobel.ts
index fc24f73b..27e9fe75 100644
--- a/examples-testing/examples/webgpu_postprocessing_sobel.ts
+++ b/examples-testing/examples/webgpu_postprocessing_sobel.ts
@@ -8,8 +8,8 @@ import { pass } from 'three/nodes';

import { GUI } from 'three/addons/libs/lil-gui.module.min.js';

-let camera, scene, renderer;
-let postProcessing;
+let camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: WebGPURenderer;
+let postProcessing: PostProcessing;

const params = {
enable: true,
diff --git a/examples-testing/examples/webgpu_textures_anisotropy.ts b/examples-testing/examples/webgpu_textures_anisotropy.ts
index ca0ae9e7..2125232e 100644
--- a/examples-testing/examples/webgpu_textures_anisotropy.ts
Expand Down
1 change: 1 addition & 0 deletions types/three/examples/jsm/nodes/Nodes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ export { default as FrontFacingNode, faceDirection, frontFacing } from "./displa
export { default as GaussianBlurNode, gaussianBlur } from "./display/GaussianBlurNode.js";
export { default as NormalMapNode, normalMap } from "./display/NormalMapNode.js";
export { default as PosterizeNode, posterize } from "./display/PosterizeNode.js";
export { default as SobelOperatorNode, sobel } from "./display/SobelOperatorNode.js";
export { default as ToneMappingNode, toneMapping } from "./display/ToneMappingNode.js";
export {
default as ViewportDepthNode,
Expand Down
17 changes: 17 additions & 0 deletions types/three/examples/jsm/nodes/display/SobelOperatorNode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import TextureNode from "../accessors/TextureNode.js";
import TempNode from "../core/TempNode.js";
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";

export default class SobelOperatorNode extends TempNode {
textureNode: TextureNode;

constructor(textureNode: TextureNode);
}

export const sobel: (node: NodeRepresentation) => ShaderNodeObject<SobelOperatorNode>;

declare module "../shadernode/ShaderNode.js" {
interface NodeElements {
sobel: typeof sobel;
}
}

0 comments on commit 842b6f5

Please sign in to comment.