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: Fix transmission with nested render calls. #27886

Merged
merged 2 commits into from
Mar 9, 2024

Conversation

Mugen87
Copy link
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
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
Copy link

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

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