Skip to content

WebGLRenderer: Don't support double-sided, transmissive objects with WEBGL_multisampled_render_to_texture.#28196

Merged
mrdoob merged 2 commits into
mrdoob:devfrom
Mugen87:dev1
Apr 23, 2024
Merged

WebGLRenderer: Don't support double-sided, transmissive objects with WEBGL_multisampled_render_to_texture.#28196
mrdoob merged 2 commits into
mrdoob:devfrom
Mugen87:dev1

Conversation

@Mugen87

@Mugen87 Mugen87 commented Apr 23, 2024

Copy link
Copy Markdown
Collaborator

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.

@github-actions

Copy link
Copy Markdown

📦 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
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