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: Don't support double-sided, transmissive objects with WEBGL_multisampled_render_to_texture. #28196

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Apr 23, 2024

Related issue: #28131

Description

The renderer supports double-sided, transmissive objects only with multisampled transmissive render targets. That's because the transmissive render target is used as source and target which normally would produce a feedback loop. The loop isn't "visible" because multisampled render targets use more than one framebuffer.

This assumption is not true when the WEBGL_multisampled_render_to_texture extension is available since it enables multisampling support without an explicit resolve. This currently means double-sided, transmissive objects show no inner reflections with the Quest browser and produce a WebGL warning in the browser console.

Until a solution is available (see #28131 (comment)), I suggest to exclude double-sided, transmissive objects in renderTransmissionPass() when WEBGL_multisampled_render_to_texture is available. This avoids the WebGL warning and improves the performance.

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
674.4 kB (167.1 kB) 674.4 kB (167.1 kB) +55 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
453.8 kB (109.5 kB) 453.8 kB (109.6 kB) +56 B

@mrdoob mrdoob added this to the r164 milestone Apr 23, 2024
@mrdoob mrdoob merged commit 335ba6d into mrdoob:dev Apr 23, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants