diff --git a/examples/jsm/tsl/display/AfterImageNode.js b/examples/jsm/tsl/display/AfterImageNode.js index dcccac4a6e16de..52751f3931eab8 100644 --- a/examples/jsm/tsl/display/AfterImageNode.js +++ b/examples/jsm/tsl/display/AfterImageNode.js @@ -80,6 +80,14 @@ class AfterImageNode extends TempNode { */ this._textureNodeOld = texture( this._oldRT.texture ); + /** + * The material for the composite pass. + * + * @private + * @type {?NodeMaterial} + */ + this._materialComposed = null; + /** * The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node renders * its effect once per frame in `updateBefore()`. @@ -226,6 +234,8 @@ class AfterImageNode extends TempNode { this._compRT.dispose(); this._oldRT.dispose(); + if ( this._materialComposed !== null ) this._materialComposed.dispose(); + } } diff --git a/examples/jsm/tsl/display/AnamorphicNode.js b/examples/jsm/tsl/display/AnamorphicNode.js index bc965a816cdd76..3033ca4baf1855 100644 --- a/examples/jsm/tsl/display/AnamorphicNode.js +++ b/examples/jsm/tsl/display/AnamorphicNode.js @@ -98,6 +98,15 @@ class AnamorphicNode extends TempNode { */ this._textureNode = passTexture( this, this._renderTarget.texture ); + /** + * The material for the anamorphic pass. + * + * @private + * @type {?NodeMaterial} + */ + this._material = null; + + /** * The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node renders * its effect once per frame in `updateBefore()`. @@ -239,6 +248,8 @@ class AnamorphicNode extends TempNode { this._renderTarget.dispose(); + if ( this._material !== null ) this._material.dispose(); + } /** diff --git a/examples/jsm/tsl/display/BilateralBlurNode.js b/examples/jsm/tsl/display/BilateralBlurNode.js index 8e1b407574dd5b..c0f356cc15aade 100644 --- a/examples/jsm/tsl/display/BilateralBlurNode.js +++ b/examples/jsm/tsl/display/BilateralBlurNode.js @@ -112,6 +112,14 @@ class BilateralBlurNode extends TempNode { this._textureNode = passTexture( this, this._verticalRT.texture ); this._textureNode.uvNode = textureNode.uvNode; + /** + * The material for the blur pass. + * + * @private + * @type {?NodeMaterial} + */ + this._material = null; + /** * The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node renders * its effect once per frame in `updateBefore()`. @@ -318,6 +326,8 @@ class BilateralBlurNode extends TempNode { this._horizontalRT.dispose(); this._verticalRT.dispose(); + if ( this._material !== null ) this._material.dispose(); + } /** diff --git a/examples/jsm/tsl/display/GaussianBlurNode.js b/examples/jsm/tsl/display/GaussianBlurNode.js index e84ff9ed289144..f9a16ab59489b1 100644 --- a/examples/jsm/tsl/display/GaussianBlurNode.js +++ b/examples/jsm/tsl/display/GaussianBlurNode.js @@ -98,6 +98,14 @@ class GaussianBlurNode extends TempNode { this._textureNode = passTexture( this, this._verticalRT.texture ); this._textureNode.uvNode = textureNode.uvNode; + /** + * The material for the blur pass. + * + * @private + * @type {?NodeMaterial} + */ + this._material = null; + /** * The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node renders * its effect once per frame in `updateBefore()`. @@ -303,6 +311,8 @@ class GaussianBlurNode extends TempNode { this._horizontalRT.dispose(); this._verticalRT.dispose(); + if ( this._material !== null ) this._material.dispose(); + } /** diff --git a/examples/jsm/tsl/display/SSGINode.js b/examples/jsm/tsl/display/SSGINode.js index 7c1068cff7f5ee..54f912caea8a05 100644 --- a/examples/jsm/tsl/display/SSGINode.js +++ b/examples/jsm/tsl/display/SSGINode.js @@ -461,8 +461,6 @@ class SSGINode extends TempNode { const color = vec3( 0 ); - const lastSampleViewPosition = vec3( viewPosition ).toVar(); - Loop( { start: uint( 0 ), end: STEP_COUNT, type: 'uint', condition: '<' }, ( { i } ) => { const offset = pow( abs( mul( stepRadius, float( i ).add( initialRayStep ) ).div( radiusVS ) ), EXP_FACTOR ).mul( radiusVS ).toConst(); @@ -529,8 +527,6 @@ class SSGINode extends TempNode { } ); - lastSampleViewPosition.assign( sampleViewPosition ); - } ); return vec3( color );