Skip to content
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
39 changes: 3 additions & 36 deletions examples/jsm/tsl/display/ChromaticAberrationNode.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Vector2, TempNode } from 'three/webgpu';
import { TempNode } from 'three/webgpu';
import {
nodeObject,
Fn,
uniform,
convertToTexture,
float,
vec4,
uv,
NodeUpdateType,
} from 'three/tsl';

/**
Expand Down Expand Up @@ -45,15 +43,6 @@ class ChromaticAberrationNode extends TempNode {
*/
this.textureNode = textureNode;

/**
* The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node updates
* its internal uniforms once per frame in `updateBefore()`.
*
* @type {string}
* @default 'frame'
*/
this.updateBeforeType = NodeUpdateType.FRAME;

/**
* A node holding the strength of the effect.
*
Expand All @@ -75,26 +64,6 @@ class ChromaticAberrationNode extends TempNode {
*/
this.scaleNode = scaleNode;

/**
* A uniform node holding the inverse resolution value.
*
* @private
* @type {UniformNode<vec2>}
*/
this._invSize = uniform( new Vector2() );

}

/**
* This method is used to update the effect's uniforms once per frame.
*
* @param {NodeFrame} frame - The current node frame.
*/
updateBefore( /* frame */ ) {

const map = this.textureNode.value;
this._invSize.value.set( 1 / map.image.width, 1 / map.image.height );

}

/**
Expand Down Expand Up @@ -155,8 +124,7 @@ class ChromaticAberrationNode extends TempNode {
{ name: 'uv', type: 'vec2' },
{ name: 'strength', type: 'float' },
{ name: 'center', type: 'vec2' },
{ name: 'scale', type: 'float' },
{ name: 'invSize', type: 'vec2' }
{ name: 'scale', type: 'float' }
]
} );

Expand All @@ -166,8 +134,7 @@ class ChromaticAberrationNode extends TempNode {
uvNode,
this.strengthNode,
this.centerNode,
this.scaleNode,
this._invSize
this.scaleNode
);

} );
Expand Down
2 changes: 2 additions & 0 deletions examples/jsm/tsl/display/TRAANode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ let _rendererState;
* - {@link https://alextardif.com/TAA.html}
* - {@link https://www.elopezr.com/temporal-aa-and-the-quest-for-the-holy-trail/}
*
* Note: MSAA must be disabled when TRAA is in use.
*
* @augments TempNode
* @three_import import { traa } from 'three/addons/tsl/display/TRAANode.js';
*/
Expand Down
2 changes: 1 addition & 1 deletion src/objects/InstancedMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class InstancedMesh extends Mesh {

/**
* Sets the given local transformation matrix to the defined instance. Make sure you set the `needsUpdate` flag of
* {@link InstancedMesh#instanceMatrix} to `true` after updating all the colors.
* {@link InstancedMesh#instanceMatrix} to `true` after updating all the matrices.
*
* @param {number} index - The instance index.
* @param {Matrix4} matrix - The local transformation.
Expand Down
Loading