|
@@ -137,12 +137,10 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- function getInternalFormat( texture, glFormat, glType ) {
|
|
|
|
|
|
+ function getInternalFormat( internalFormatName, glFormat, glType ) {
|
|
|
|
|
|
if ( isWebGL2 === false ) return glFormat;
|
|
if ( isWebGL2 === false ) return glFormat;
|
|
|
|
|
|
- var internalFormatName = texture.internalFormat; // User specified internal format.
|
|
|
|
-
|
|
|
|
if ( internalFormatName !== null ) {
|
|
if ( internalFormatName !== null ) {
|
|
|
|
|
|
if ( _gl[ internalFormatName ] !== undefined ) return _gl[ internalFormatName ];
|
|
if ( _gl[ internalFormatName ] !== undefined ) return _gl[ internalFormatName ];
|
|
@@ -437,7 +435,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
supportsMips = isPowerOfTwo( image ) || isWebGL2,
|
|
supportsMips = isPowerOfTwo( image ) || isWebGL2,
|
|
glFormat = utils.convert( texture.format ),
|
|
glFormat = utils.convert( texture.format ),
|
|
glType = utils.convert( texture.type ),
|
|
glType = utils.convert( texture.type ),
|
|
- glInternalFormat = getInternalFormat( texture, glFormat, glType );
|
|
|
|
|
|
+ glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType );
|
|
|
|
|
|
setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, supportsMips );
|
|
setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, supportsMips );
|
|
|
|
|
|
@@ -659,7 +657,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
var supportsMips = isPowerOfTwo( image ) || isWebGL2,
|
|
var supportsMips = isPowerOfTwo( image ) || isWebGL2,
|
|
glFormat = utils.convert( texture.format ),
|
|
glFormat = utils.convert( texture.format ),
|
|
glType = utils.convert( texture.type ),
|
|
glType = utils.convert( texture.type ),
|
|
- glInternalFormat = getInternalFormat( texture, glFormat, glType );
|
|
|
|
|
|
+ glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType );
|
|
|
|
|
|
setTextureParameters( textureType, texture, supportsMips );
|
|
setTextureParameters( textureType, texture, supportsMips );
|
|
|
|
|
|
@@ -832,7 +830,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
var glFormat = utils.convert( renderTarget.texture.format );
|
|
var glFormat = utils.convert( renderTarget.texture.format );
|
|
var glType = utils.convert( renderTarget.texture.type );
|
|
var glType = utils.convert( renderTarget.texture.type );
|
|
- var glInternalFormat = getInternalFormat( renderTarget.texture, glFormat, glType );
|
|
|
|
|
|
+ var glInternalFormat = getInternalFormat( renderTarget.texture.internalFormat, glFormat, glType );
|
|
state.texImage2D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
|
|
state.texImage2D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
|
|
_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
|
|
_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
|
|
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( renderTarget.texture ).__webglTexture, 0 );
|
|
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( renderTarget.texture ).__webglTexture, 0 );
|
|
@@ -882,7 +880,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
var glFormat = utils.convert( renderTarget.texture.format );
|
|
var glFormat = utils.convert( renderTarget.texture.format );
|
|
var glType = utils.convert( renderTarget.texture.type );
|
|
var glType = utils.convert( renderTarget.texture.type );
|
|
- var glInternalFormat = getInternalFormat( renderTarget.texture, glFormat, glType );
|
|
|
|
|
|
+ var glInternalFormat = getInternalFormat( renderTarget.texture.internalFormat, glFormat, glType );
|
|
|
|
|
|
if ( isMultisample ) {
|
|
if ( isMultisample ) {
|
|
|
|
|
|
@@ -1029,9 +1027,10 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
renderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();
|
|
renderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();
|
|
|
|
|
|
_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer );
|
|
_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer );
|
|
|
|
+
|
|
var glFormat = utils.convert( renderTarget.texture.format );
|
|
var glFormat = utils.convert( renderTarget.texture.format );
|
|
var glType = utils.convert( renderTarget.texture.type );
|
|
var glType = utils.convert( renderTarget.texture.type );
|
|
- var glInternalFormat = getInternalFormat( renderTarget.texture, glFormat, glType );
|
|
|
|
|
|
+ var glInternalFormat = getInternalFormat( renderTarget.texture.internalFormat, glFormat, glType );
|
|
var samples = getRenderTargetSamples( renderTarget );
|
|
var samples = getRenderTargetSamples( renderTarget );
|
|
_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );
|
|
_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );
|
|
|
|
|