Explorar el Código

rendertarget resizable

drop current rendertarget when resized; will be recreated in next render
Ben Adams hace 10 años
padre
commit
d29d97fbbb
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  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 () {