Skip to content

UniformsUtils: Check for XRRenderTarget in getUnlitUniformColorSpace#27869

Merged
Mugen87 merged 2 commits into
mrdoob:devfrom
mrxz:webxr-fog-and-background
Mar 6, 2024
Merged

UniformsUtils: Check for XRRenderTarget in getUnlitUniformColorSpace#27869
Mugen87 merged 2 commits into
mrdoob:devfrom
mrxz:webxr-fog-and-background

Conversation

@mrxz
Copy link
Copy Markdown
Contributor

@mrxz mrxz commented Mar 4, 2024

Fixed #27868

Description

Adds a check to getUnlitUniformColorSpace to return the render target's texture colour space in case of the WebXR render target. With this change both fog colour and background colour remain consistent inside and outside VR sessions. This is similar to the logic in WebGLProgams.js and WebGLRenderer.js.

This contribution is funded by Fern Solutions

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 4, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
669.5 kB (166.1 kB) 669.6 kB (166.2 kB) +55 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
449.7 kB (108.8 kB) 449.8 kB (108.8 kB) +55 B

@Mugen87 Mugen87 added this to the r163 milestone Mar 4, 2024
Comment thread src/renderers/shaders/UniformsUtils.js
@donmccurdy
Copy link
Copy Markdown
Collaborator

Note — I don't have access to a WebXR-compatible device at the moment. Could someone test that background and fog colors work as expected in a WebXR session before this is merged?

Co-authored-by: Don McCurdy <dm@donmccurdy.com>
@mrxz
Copy link
Copy Markdown
Contributor Author

mrxz commented Mar 6, 2024

@donmccurdy Here are some screenshots taken with a Meta Quest 3 on a test scene.

Outside WebXR In WebXR Session
Without this PR image image
With this PR image image

@Mugen87 Mugen87 merged commit 99d87b9 into mrdoob:dev Mar 6, 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.

WebXR: Scene fog and background appear darker in VR

3 participants