-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
WebGLTextures: Fix multisampled rendering for non-Quest VR browsers. #24689
Conversation
The title is a bit confusing. Three is currently broken for:
This error was found by developers that are trying to use the polyfill so their layers code works on other browser. |
I've tested the PR in more detail on dev and encounter the following problem on
The render target creation is just changed from
to const renderTarget = new THREE.WebGLRenderTarget( size.width, size.height, { samples: 4, encoding: THREE.sRGBEncoding } ); This is a regression since having multisampled sRGB render targets should work as before. |
Maybe we need a separate code path (or additional checks) to differentiate between WebXR and non-WebXR? |
I've reverted the PR for now since |
I'm looking at this code for depth buffers and it seems there is a lot of confusion in this area. |
When the
WEBGL_multisampled_render_to_texture
extension is not available, three.js falls back to using renderbuffers to get support for multisampled rendering.However, there was a change that forces the renderbuffer to sRGB. This result in a GL error when it tries to copy the MSAA renderbuffer into the WebXR texture.
The fix now correctly flags the
getInternalFormat
call to not choose sRGBA.This contribution is funded by Meta