|
@@ -2573,7 +2573,7 @@ class Vector4 {
|
|
*/
|
|
*/
|
|
|
|
|
|
class WebGLRenderTarget extends EventDispatcher {
|
|
class WebGLRenderTarget extends EventDispatcher {
|
|
- constructor(width, height, options = {}) {
|
|
|
|
|
|
+ constructor(width = 1, height = 1, options = {}) {
|
|
super();
|
|
super();
|
|
this.isWebGLRenderTarget = true;
|
|
this.isWebGLRenderTarget = true;
|
|
this.width = width;
|
|
this.width = width;
|
|
@@ -2664,7 +2664,7 @@ class DataArrayTexture extends Texture {
|
|
}
|
|
}
|
|
|
|
|
|
class WebGLArrayRenderTarget extends WebGLRenderTarget {
|
|
class WebGLArrayRenderTarget extends WebGLRenderTarget {
|
|
- constructor(width, height, depth) {
|
|
|
|
|
|
+ constructor(width = 1, height = 1, depth = 1) {
|
|
super(width, height);
|
|
super(width, height);
|
|
this.isWebGLArrayRenderTarget = true;
|
|
this.isWebGLArrayRenderTarget = true;
|
|
this.depth = depth;
|
|
this.depth = depth;
|
|
@@ -2702,7 +2702,7 @@ class Data3DTexture extends Texture {
|
|
}
|
|
}
|
|
|
|
|
|
class WebGL3DRenderTarget extends WebGLRenderTarget {
|
|
class WebGL3DRenderTarget extends WebGLRenderTarget {
|
|
- constructor(width, height, depth) {
|
|
|
|
|
|
+ constructor(width = 1, height = 1, depth = 1) {
|
|
super(width, height);
|
|
super(width, height);
|
|
this.isWebGL3DRenderTarget = true;
|
|
this.isWebGL3DRenderTarget = true;
|
|
this.depth = depth;
|
|
this.depth = depth;
|
|
@@ -2713,7 +2713,7 @@ class WebGL3DRenderTarget extends WebGLRenderTarget {
|
|
}
|
|
}
|
|
|
|
|
|
class WebGLMultipleRenderTargets extends WebGLRenderTarget {
|
|
class WebGLMultipleRenderTargets extends WebGLRenderTarget {
|
|
- constructor(width, height, count, options = {}) {
|
|
|
|
|
|
+ constructor(width = 1, height = 1, count = 1, options = {}) {
|
|
super(width, height, options);
|
|
super(width, height, options);
|
|
this.isWebGLMultipleRenderTargets = true;
|
|
this.isWebGLMultipleRenderTargets = true;
|
|
const texture = this.texture;
|
|
const texture = this.texture;
|
|
@@ -9090,7 +9090,7 @@ class CubeTexture extends Texture {
|
|
}
|
|
}
|
|
|
|
|
|
class WebGLCubeRenderTarget extends WebGLRenderTarget {
|
|
class WebGLCubeRenderTarget extends WebGLRenderTarget {
|
|
- constructor(size, options = {}) {
|
|
|
|
|
|
+ constructor(size = 1, options = {}) {
|
|
super(size, size, options);
|
|
super(size, size, options);
|
|
this.isWebGLCubeRenderTarget = true;
|
|
this.isWebGLCubeRenderTarget = true;
|
|
const image = {
|
|
const image = {
|
|
@@ -17345,7 +17345,8 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
if (useMultisampledRTT(renderTarget)) {
|
|
if (useMultisampledRTT(renderTarget)) {
|
|
multisampledRTTExt.framebufferTexture2DMultisampleEXT(_gl.FRAMEBUFFER, attachment, textureTarget, properties.get(texture).__webglTexture, 0, getRenderTargetSamples(renderTarget));
|
|
multisampledRTTExt.framebufferTexture2DMultisampleEXT(_gl.FRAMEBUFFER, attachment, textureTarget, properties.get(texture).__webglTexture, 0, getRenderTargetSamples(renderTarget));
|
|
- } else {
|
|
|
|
|
|
+ } else if (textureTarget === _gl.TEXTURE_2D || textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z) {
|
|
|
|
+ // see #24753
|
|
_gl.framebufferTexture2D(_gl.FRAMEBUFFER, attachment, textureTarget, properties.get(texture).__webglTexture, 0);
|
|
_gl.framebufferTexture2D(_gl.FRAMEBUFFER, attachment, textureTarget, properties.get(texture).__webglTexture, 0);
|
|
}
|
|
}
|
|
|
|
|