Browse Source

rendertarget resizable

drop current rendertarget when resized; will be recreated in next render
Ben Adams 10 years ago
parent
commit
d29d97fbbb
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/renderers/WebGLRenderTarget.js

+ 7 - 2
src/renderers/WebGLRenderTarget.js

@@ -39,9 +39,14 @@ THREE.WebGLRenderTarget.prototype = {
 
 	setSize: function ( width, height ) {
 
-		this.width = width;
-		this.height = height;
+		if ( this.width !== width || this.height !== height ) {
 
+			this.width = width;
+			this.height = height;
+
+			this.dispose();
+
+		}
 	},
 
 	clone: function () {