Преглед на файлове

rendertarget resizable

drop current rendertarget when resized; will be recreated in next render
Ben Adams преди 11 години
родител
ревизия
d29d97fbbb
променени са 1 файла, в които са добавени 7 реда и са изтрити 2 реда
  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 () {

粤ICP备19079148号