Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getting float render target extensions #21069

Merged
merged 2 commits into from
Jan 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,11 @@ function WebGLRenderer( parameters ) {

capabilities = new WebGLCapabilities( _gl, extensions, parameters );

if ( capabilities.isWebGL2 === false ) {
if ( capabilities.isWebGL2 ) {

extensions.get( 'EXT_color_buffer_float' );

} else {

extensions.get( 'WEBGL_depth_texture' );
extensions.get( 'OES_texture_float' );
Expand All @@ -290,6 +294,7 @@ function WebGLRenderer( parameters ) {
}

extensions.get( 'OES_texture_float_linear' );
extensions.get( 'EXT_color_buffer_half_float' );

utils = new WebGLUtils( _gl, extensions, capabilities );

Expand Down Expand Up @@ -1889,9 +1894,11 @@ function WebGLRenderer( parameters ) {

}

const halfFloatSupportedByExt = textureType === HalfFloatType && ( extensions.get( 'EXT_color_buffer_half_float' ) || ( capabilities.isWebGL2 && extensions.get( 'EXT_color_buffer_float' ) ) );
Mugen87 marked this conversation as resolved.
Show resolved Hide resolved

if ( textureType !== UnsignedByteType && utils.convert( textureType ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // IE11, Edge and Chrome Mac < 52 (#9513)
! ( textureType === FloatType && ( capabilities.isWebGL2 || extensions.get( 'OES_texture_float' ) || extensions.get( 'WEBGL_color_buffer_float' ) ) ) && // Chrome Mac >= 52 and Firefox
! ( textureType === HalfFloatType && ( capabilities.isWebGL2 ? extensions.get( 'EXT_color_buffer_float' ) : extensions.get( 'EXT_color_buffer_half_float' ) ) ) ) {
! halfFloatSupportedByExt ) {

console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
return;
Expand Down