Repository navigation
Size splats by the viewport they are drawn in - #487
Merged
Merged
Conversation
Splats drawn in a viewport smaller than the canvas or render target, such as one WebXR eye, used the full size, so their anti-alias blur and size limit were too small. The viewport's size is now used.
oscarlorentzon
force-pushed
the
xr-render-size
branch
from
October 16, 2026 17:18
2a4de0e to
afd4aa7
Compare
Contributor
|
sweet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In WebXR, three.js draws both eyes into one render target, each eye into its own viewport of it, but
SparkRenderersized splats by the whole target. With the eyes side by side, the anti-alias blur added to every splat was half as wide across, and the largest splats were drawn at half their width.SparkRenderernow sizes splats for the area being drawn, so each eye renders like a desktop view of its size. Custom generators get the same size.three.js keeps the area being drawn in two places:
camera.viewport, which each WebXR eye andArrayCameracamera is drawn with, and the renderer's current viewport.SparkRendererpreferscamera.viewport, becauseReflector,RefractorandWaterreset the renderer's, and falls back to the renderer's forsetViewport, which sets only that one. three.js picks the viewport in the same order for its transmission pass.Verification
main: an eye in a 100×100 viewport of a 200×100 XR target gets 200×100, and asetViewportcamera gets the canvas size.npm run test:browserandnpm run buildpass.