Skip to content

Commit

Permalink
TSL: Update DoF node and example (#1085)
Browse files Browse the repository at this point in the history
* TSL: Update DoF node and example

* Update three.js

* Add examples

* Update patch

* Delete examples
  • Loading branch information
Methuselah96 authored Jul 20, 2024
1 parent 95a2265 commit aadb23b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14396,13 +14396,13 @@ index 4c3a1d66..4337b2c8 100644
postProcessing.outputNode = combinedPass;

diff --git a/examples-testing/examples/webgpu_postprocessing_dof.ts b/examples-testing/examples/webgpu_postprocessing_dof.ts
index 3c7870c8..f1dbc7cb 100644
index 3fb4046b..785a78f8 100644
--- a/examples-testing/examples/webgpu_postprocessing_dof.ts
+++ b/examples-testing/examples/webgpu_postprocessing_dof.ts
@@ -1,4 +1,4 @@
-import * as THREE from 'three';
+import * as THREE from 'three/webgpu';
import { cubeTexture, positionWorld, oscSine, timerGlobal, pass } from 'three/tsl';
import { cubeTexture, positionWorld, oscSine, timerGlobal, pass, uniform } from 'three/tsl';

import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
@@ -7,7 +7,11 @@ import Stats from 'three/addons/libs/stats.module.js';
Expand All @@ -14427,8 +14427,8 @@ index 3c7870c8..f1dbc7cb 100644

init();

@@ -127,7 +131,7 @@ function init() {
updateEffect();
@@ -124,7 +128,7 @@ function init() {
gui.add(effectController.maxblur, 'value', 0.0, 0.01, 0.001).name('maxblur');
}

-function onPointerMove(event) {
Expand Down
2 changes: 1 addition & 1 deletion three.js
8 changes: 4 additions & 4 deletions types/three/src/nodes/display/DepthOfFieldNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ export default class DepthOfFieldNode extends TempNode {
aperture: UniformNode<number>;
maxblur: UniformNode<number>;

constructor(textureNode: TextureNode, viewZNode: Node, focus?: number, aperture?: number, maxblur?: number);
constructor(textureNode: TextureNode, viewZNode: Node, focusNode: Node, apertureNode: Node, maxblurNode: Node);
}

export const dof: (
node: NodeRepresentation,
viewZNode: NodeRepresentation,
focus?: number,
aperture?: number,
maxblur?: number,
focus?: NodeRepresentation,
aperture?: NodeRepresentation,
maxblur?: NodeRepresentation,
) => ShaderNodeObject<DepthOfFieldNode>;

declare module "../shadernode/ShaderNode.js" {
Expand Down

0 comments on commit aadb23b

Please sign in to comment.