Add GPU sphere intersection queries for Gaussian splats#39
Draft
andybak wants to merge 4 commits into
Draft
Conversation
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.
This PR adds a runtime sphere-intersection query to
GsplatRenderer. It is intendedfor tools that need to determine whether a world-space sphere overlaps any uploaded
splat, such as selection widgets or spatial interaction tools.
The query transforms the sphere into renderer-local space, dispatches a compute
shader over the uploaded splats, and reads back a one-element hit buffer. Both Spark
and Uncompressed GPU resource layouts are supported.
Public API
The method returns
truewhen at least one splat intersects the sphere. The currentimplementation returns a binary score of
1.0for a hit and leaves the score at-1.0when there is no hit or the renderer cannot be queried.Main changes
GsplatRenderer.TryIntersectSphere.splat downscale factor.
GsplatSettingsdefaults.Risk and performance
The method performs a synchronous GPU readback through
GraphicsBuffer.GetData.Calling it frequently or once per renderer every frame can stall the CPU waiting for
the GPU. The intended use should therefore be occasional interaction queries unless
the implementation is later converted to asynchronous readback or batching.
The returned score is currently binary rather than a distance or overlap measure.
Suggested testing
SplatDownscaleFactor.