Skip to content

WebGLRenderer: Fix transmission with nested render calls.#27886

Merged
mrdoob merged 2 commits into
mrdoob:devfrom
Mugen87:dev78
Mar 9, 2024
Merged

WebGLRenderer: Fix transmission with nested render calls.#27886
mrdoob merged 2 commits into
mrdoob:devfrom
Mugen87:dev78

Conversation

@Mugen87
Copy link
Copy Markdown
Collaborator

@Mugen87 Mugen87 commented Mar 8, 2024

Fixed #27846.

Description

This PR makes sure transmission can be used when a scene is rendered with nested render calls which is for example true when using mirrors. This fixes the instance of Reflector in the webxr_vr_sandbox example which was also reported in #27846.

Thanks to @LR17's research we know now that without this change the contents of the (single) transmission render target would be overwritten. By having a render target for each render state, this does not happen anymore.

textureWidth: window.innerWidth * window.devicePixelRatio,
textureHeight: window.innerHeight * window.devicePixelRatio
textureWidth: window.innerWidth,
textureHeight: window.innerHeight
Copy link
Copy Markdown
Collaborator Author

@Mugen87 Mugen87 Mar 8, 2024

Choose a reason for hiding this comment

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

I've decreased the resolution a bit otherwise rendering becomes too fragment shader heavy.

@Mugen87 Mugen87 added this to the r163 milestone Mar 8, 2024
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 8, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
669.5 kB (166.1 kB) 669.7 kB (166.2 kB) +121 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
449.8 kB (108.8 kB) 449.9 kB (108.8 kB) +120 B

@mrdoob mrdoob merged commit 73762af into mrdoob:dev Mar 9, 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.

Transmission not working properly when a Reflector is added to the scene

2 participants