Skip to content

Commit

Permalink
Nodes: Add FXAANode. (#1109)
Browse files Browse the repository at this point in the history
* Nodes: Add FXAANode.

* Update three.js

* Add examples

* Update patch and delete examples
  • Loading branch information
Methuselah96 authored Jul 22, 2024
1 parent c25e596 commit 102cd9a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
25 changes: 25 additions & 0 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14695,6 +14695,31 @@ index 3fb4046b..785a78f8 100644
if (event.isPrimary === false) return;

mouseX = event.clientX - windowHalfX;
diff --git a/examples-testing/examples/webgpu_postprocessing_fxaa.ts b/examples-testing/examples/webgpu_postprocessing_fxaa.ts
index 5e75fa7a..dfebe406 100644
--- a/examples-testing/examples/webgpu_postprocessing_fxaa.ts
+++ b/examples-testing/examples/webgpu_postprocessing_fxaa.ts
@@ -1,4 +1,4 @@
-import * as THREE from 'three';
+import * as THREE from 'three/webgpu';
import { pass, renderOutput } from 'three/tsl';

import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
@@ -8,8 +8,12 @@ const params = {
animated: false,
};

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

init();

diff --git a/examples-testing/examples/webgpu_postprocessing_sobel.ts b/examples-testing/examples/webgpu_postprocessing_sobel.ts
index cbc5a96b..66ec682e 100644
--- a/examples-testing/examples/webgpu_postprocessing_sobel.ts
Expand Down
1 change: 1 addition & 0 deletions types/three/src/nodes/Nodes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ 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";
export { default as FrontFacingNode, faceDirection, frontFacing } from "./display/FrontFacingNode.js";
export { default as FXAANode, fxaa } from "./display/FXAANode.js";
export { default as GaussianBlurNode, gaussianBlur } from "./display/GaussianBlurNode.js";
export { ao, default as GTAONode } from "./display/GTAONode.js";
export { default as Lut3DNode, lut3D } from "./display/Lut3DNode.js";
Expand Down
19 changes: 19 additions & 0 deletions types/three/src/nodes/display/FXAANode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import TextureNode from "../accessors/TextureNode.js";
import TempNode from "../core/TempNode.js";
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";

declare class FXAANode extends TempNode {
textureNode: TextureNode;

constructor(textureNode: TextureNode);
}

export const fxaa: (node: NodeRepresentation) => ShaderNodeObject<FXAANode>;

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

export default FXAANode;

0 comments on commit 102cd9a

Please sign in to comment.