Ver Fonte

Nodes: Add missing `dispose()` methods. (#28892)

Michael Herzog há 1 ano atrás
pai
commit
7a91d803ab

+ 7 - 0
src/nodes/display/AfterImageNode.js

@@ -135,6 +135,13 @@ class AfterImageNode extends TempNode {
 
 	}
 
+	dispose() {
+
+		this._compRT.dispose();
+		this._oldRT.dispose();
+
+	}
+
 }
 
 export const afterImage = ( node, damp ) => nodeObject( new AfterImageNode( nodeObject( node ).toTexture(), damp ) );

+ 6 - 0
src/nodes/display/AnamorphicNode.js

@@ -129,6 +129,12 @@ class AnamorphicNode extends TempNode {
 
 	}
 
+	dispose() {
+
+		this._renderTarget.dispose();
+
+	}
+
 }
 
 export const anamorphic = ( node, threshold = .9, scale = 3, samples = 32 ) => nodeObject( new AnamorphicNode( nodeObject( node ).toTexture(), nodeObject( threshold ), nodeObject( scale ), samples ) );

+ 6 - 0
src/nodes/display/GTAONode.js

@@ -225,6 +225,12 @@ class GTAONode extends TempNode {
 
 	}
 
+	dispose() {
+
+		this._aoRenderTarget.dispose();
+
+	}
+
 }
 
 function generateMagicSquareNoise( size = 5 ) {

+ 7 - 0
src/nodes/display/GaussianBlurNode.js

@@ -176,6 +176,13 @@ class GaussianBlurNode extends TempNode {
 
 	}
 
+	dispose() {
+
+		this._horizontalRT.dispose();
+		this._verticalRT.dispose();
+
+	}
+
 	_getCoefficients( kernelRadius ) {
 
 		const coefficients = [];