Skip to content

Commit d29d97f

Browse files
committed
rendertarget resizable
drop current rendertarget when resized; will be recreated in next render
1 parent 5603241 commit d29d97f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/renderers/WebGLRenderTarget.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,14 @@ THREE.WebGLRenderTarget.prototype = {
3939

4040
setSize: function ( width, height ) {
4141

42-
this.width = width;
43-
this.height = height;
42+
if ( this.width !== width || this.height !== height ) {
4443

44+
this.width = width;
45+
this.height = height;
46+
47+
this.dispose();
48+
49+
}
4550
},
4651

4752
clone: function () {

0 commit comments

Comments
 (0)