|
@@ -3,9 +3,7 @@ import {
|
|
BackSide,
|
|
BackSide,
|
|
FrontSide,
|
|
FrontSide,
|
|
DoubleSide,
|
|
DoubleSide,
|
|
- RGBAFormat,
|
|
|
|
HalfFloatType,
|
|
HalfFloatType,
|
|
- FloatType,
|
|
|
|
UnsignedByteType,
|
|
UnsignedByteType,
|
|
NoToneMapping,
|
|
NoToneMapping,
|
|
LinearMipmapLinearFilter,
|
|
LinearMipmapLinearFilter,
|
|
@@ -292,10 +290,10 @@ class WebGLRenderer {
|
|
extensions = new WebGLExtensions( _gl );
|
|
extensions = new WebGLExtensions( _gl );
|
|
extensions.init();
|
|
extensions.init();
|
|
|
|
|
|
- capabilities = new WebGLCapabilities( _gl, extensions, parameters );
|
|
|
|
-
|
|
|
|
utils = new WebGLUtils( _gl, extensions );
|
|
utils = new WebGLUtils( _gl, extensions );
|
|
|
|
|
|
|
|
+ capabilities = new WebGLCapabilities( _gl, extensions, parameters, utils );
|
|
|
|
+
|
|
state = new WebGLState( _gl );
|
|
state = new WebGLState( _gl );
|
|
|
|
|
|
info = new WebGLInfo( _gl );
|
|
info = new WebGLInfo( _gl );
|
|
@@ -2288,17 +2286,14 @@ class WebGLRenderer {
|
|
const textureFormat = texture.format;
|
|
const textureFormat = texture.format;
|
|
const textureType = texture.type;
|
|
const textureType = texture.type;
|
|
|
|
|
|
- if ( textureFormat !== RGBAFormat && utils.convert( textureFormat ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {
|
|
|
|
|
|
+ if ( ! capabilities.textureFormatReadable( textureFormat ) ) {
|
|
|
|
|
|
console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
|
|
console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
|
|
return;
|
|
return;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- const halfFloatSupportedByExt = ( textureType === HalfFloatType ) && ( extensions.has( 'EXT_color_buffer_half_float' ) || extensions.has( 'EXT_color_buffer_float' ) );
|
|
|
|
-
|
|
|
|
- if ( textureType !== UnsignedByteType && utils.convert( textureType ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // Edge and Chrome Mac < 52 (#9513)
|
|
|
|
- textureType !== FloatType && ! halfFloatSupportedByExt ) {
|
|
|
|
|
|
+ if ( ! capabilities.textureTypeReadable( textureType ) ) {
|
|
|
|
|
|
console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
|
|
console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
|
|
return;
|
|
return;
|