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

WebGLRenderer: Check for EXT_color_buffer_float for transmission. #27761

Merged
merged 6 commits into from
Mar 4, 2024
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
4 changes: 2 additions & 2 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ class WebGLRenderer {

_transmissionRenderTarget = new WebGLRenderTarget( 1, 1, {
generateMipmaps: true,
type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType,
type: ( extensions.has( 'EXT_color_buffer_half_float' ) || extensions.has( 'EXT_color_buffer_float' ) ) ? HalfFloatType : UnsignedByteType,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, there is no system that supports EXT_color_buffer_float but not EXT_color_buffer_half_float. Since the transmission render target only uses HalfFloatType and not FloatType, I'm afraid this addition does not make sense.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusingly the EXT_color_buffer_float extension may imply that half float types are supported. From the spec:

The following floating-point internal formats become color-renderable: R16F, RG16F, RGBA16F, R32F, RG32F, RGBA32F and R11F_G11F_B10F. A renderbuffer or a texture with a color-renderable internal format can be used as a rendering target by attaching it to a framebuffer object as a color attachment.

If a device reports that EXT_color_buffer_float but for some reason doesn't report EXT_color_buffer_half_float we should still support rendering to half float buffers.

Copy link
Collaborator

@Mugen87 Mugen87 Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then let's merge for the case a device only reports EXT_color_buffer_float support.

minFilter: LinearMipmapLinearFilter,
samples: 4
} );
Expand Down Expand Up @@ -2294,7 +2294,7 @@ class WebGLRenderer {

}

const halfFloatSupportedByExt = ( textureType === HalfFloatType ) && ( extensions.has( 'EXT_color_buffer_half_float' ) || ( extensions.has( 'EXT_color_buffer_float' ) ) );
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 ) {
Expand Down