|
|
@@ -1295,12 +1295,21 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
}
|
|
|
|
|
|
- const level = 0;
|
|
|
- const internalFormat = _gl.RGBA;
|
|
|
- const srcFormat = _gl.RGBA;
|
|
|
- const srcType = _gl.UNSIGNED_BYTE;
|
|
|
+ if ( _gl.texElementImage2D.length === 3 ) {
|
|
|
+
|
|
|
+ _gl.texElementImage2D( _gl.TEXTURE_2D, _gl.RGBA8, image );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ const level = 0;
|
|
|
+ const internalFormat = _gl.RGBA;
|
|
|
+ const srcFormat = _gl.RGBA;
|
|
|
+ const srcType = _gl.UNSIGNED_BYTE;
|
|
|
+
|
|
|
+ _gl.texElementImage2D( _gl.TEXTURE_2D, level, internalFormat, srcFormat, srcType, image );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- _gl.texElementImage2D( _gl.TEXTURE_2D, level, internalFormat, srcFormat, srcType, image );
|
|
|
_gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_MIN_FILTER, _gl.LINEAR );
|
|
|
_gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE );
|
|
|
_gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE );
|