Skip to content

Conversation

@mrxz
Copy link
Collaborator

@mrxz mrxz commented Jun 27, 2025

The rendererSize was retrieved using WebGLRenderer.getSize(target). However, this method returns the size in logical pixels, whereas the actual size in physical pixels is needed. Using getDrawingBufferSize resolves this issue and returns the correct value for High-DPI displays (when pixelRatio != 1) and during WebXR sessions (both with and without WebXR Layers)

The AVP specific workaround puzzles me a bit. Unless this was written against an old version of Three.js, the size should be kept in sync. So getSize() returning 1x1 would imply a 1x1 render target being created for WebXR, which would be entirely unusable. @dmarcos Could you verify that rendering on an AVP works with these changes and that the workaround is no longer needed?

@dmarcos
Copy link
Contributor

dmarcos commented Jun 27, 2025

Thanks so much. I’ll try later today when I have my AVP available.

@mrxz
Copy link
Collaborator Author

mrxz commented Jun 27, 2025

Here's an example that shows the difference it makes. Note that the effect is more pronounced in the image compared to when viewed on an actual high DPI display:
difference

Splat source: https://note.com/steam_studio/n/ne9736d94f162 (using the cactus_splat3_30kSteps_142k_splats.compressed.ply file)

@asundqui
Copy link
Contributor

@mrxz this is truly an amazing find! Thank you so much for digging in and really getting to the root of what was going on.

I tested your fix and yes can confirm it makes it sharper. I tested on Vision Pro and for me unfortunately that strange 1x1 size workaround was necessary to make it work. I tested Quest 3 and it works correctly with this workout. I've pushed the workaround to this PR.

@dmarcos I think we should merge this in, do you want to check my workaround on Vision Pro?

@dmarcos
Copy link
Contributor

dmarcos commented Jun 29, 2025

Awesome work! Thanks so much. @mrxz workaround acceptable for now? I’ll verify on AVP before release

@asundqui asundqui mentioned this pull request Jun 30, 2025
@mrxz
Copy link
Collaborator Author

mrxz commented Jun 30, 2025

Thanks for confirming that the workaround for the AVP is actually still needed. Definitely a weird quirk of Apple's WebXR implementation. Ideally this will be fixed upstream, but in the meantime having this workaround is acceptable. I'm going to open an issue on the immersive-web/webxr repo as I'm not sure Apple is spec compliant here or not.

See: immersive-web/webxr#1410

@dmarcos
Copy link
Contributor

dmarcos commented Jun 30, 2025

Thanks so much!

@dmarcos dmarcos merged commit 860b39a into sparkjsdev:main Jun 30, 2025
2 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.

3 participants