Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: Improve AO demo. #1113

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14624,12 +14624,12 @@ index 4c3a1d66..4337b2c8 100644
postProcessing.outputNode = combinedPass;

diff --git a/examples-testing/examples/webgpu_postprocessing_ao.ts b/examples-testing/examples/webgpu_postprocessing_ao.ts
index c3af1121..7c941555 100644
index 432d641a..1434cc30 100644
--- a/examples-testing/examples/webgpu_postprocessing_ao.ts
+++ b/examples-testing/examples/webgpu_postprocessing_ao.ts
@@ -1,5 +1,16 @@
@@ -1,5 +1,18 @@
-import * as THREE from 'three';
-import { pass, mrt, output, transformedNormalView, texture, ao } from 'three/tsl';
-import { pass, mrt, output, transformedNormalView, texture, ao, denoise } from 'three/tsl';
+import * as THREE from 'three/webgpu';
+import {
+ pass,
Expand All @@ -14638,21 +14638,23 @@ index c3af1121..7c941555 100644
+ transformedNormalView,
+ texture,
+ ao,
+ denoise,
+ ShaderNodeObject,
+ GTAONode,
+ DenoiseNode,
+ OperatorNode,
+ Node,
+} from 'three/tsl';

import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
@@ -10,9 +21,19 @@ import { SimplexNoise } from 'three/addons/math/SimplexNoise.js';
@@ -10,9 +23,20 @@ import { SimplexNoise } from 'three/addons/math/SimplexNoise.js';
import Stats from 'three/addons/libs/stats.module.js';
import { GUI } from 'three/addons/libs/lil-gui.module.min.js';

-let camera, scene, renderer, postProcessing, controls, clock, stats, mixer;
-
-let aoPass, blendPassAO, blendPassDenoise, scenePassColor;
-let aoPass, denoisePass, blendPassAO, blendPassDenoise, scenePassColor;
+let camera: THREE.PerspectiveCamera,
+ scene: THREE.Scene,
+ renderer: THREE.WebGPURenderer,
Expand All @@ -14663,6 +14665,7 @@ index c3af1121..7c941555 100644
+ mixer: THREE.AnimationMixer;
+
+let aoPass: ShaderNodeObject<GTAONode>,
+ denoisePass: ShaderNodeObject<DenoiseNode>,
+ blendPassAO: ShaderNodeObject<OperatorNode>,
+ blendPassDenoise: ShaderNodeObject<OperatorNode>,
+ scenePassColor: ShaderNodeObject<Node>;
Expand Down Expand Up @@ -15444,16 +15447,3 @@ index 2cd50ba4..b97f3eee 100644

isDepthSupplied = false;
});
diff --git a/types/three/src/nodes/display/GTAONode.d.ts b/types/three/src/nodes/display/GTAONode.d.ts
index 16e30199..5a6da521 100644
--- a/types/three/src/nodes/display/GTAONode.d.ts
+++ b/types/three/src/nodes/display/GTAONode.d.ts
@@ -26,7 +26,7 @@ declare class GTAONode extends TempNode {

constructor(depthNode: Node, normalNode: Node, camera: Camera);

- getTextureNode(): TextureNode;
+ getTextureNode(): ShaderNodeObject<TextureNode>;

setSize(width: number, height: number): void;
}
2 changes: 1 addition & 1 deletion three.js
Loading