-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Sogs updates #7662
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
Sogs updates #7662
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the SOGS runtime to combine texture resources, improve quaternion storage precision, and reorder GPU data for better memory cache coherency.
- Combine separate label textures into a unified texture and merge Gaussian color and opacity data.
- Update quaternion unpacking and storage using a (2, 8, 8, 8) bit scheme.
- Introduce a GPU-based reordering step that computes Morton order indices to improve runtime memory performance.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/scene/shader-lib/chunks/gsplat/vert/gsplatSogsSH.js | Combined label uniforms into a single texture uniform. |
src/scene/shader-lib/chunks/gsplat/vert/gsplatSogsData.js | Updated quaternion reading logic using a mode-based selection. |
src/scene/shader-lib/chunks/gsplat/vert/gsplatSogsColor.js | Merged sh0 and opacity data into one texture and adjusted processing. |
src/scene/shader-lib/chunks/gsplat/vert/gsplatData.js | Modified quaternion unpacking calls to support new bit storage order. |
src/scene/shader-lib/chunks/gsplat/vert/gsplatCompressedData.js | Removed obsolete quaternion conversion function. |
src/scene/shader-lib/chunks/gsplat/vert/gsplatCommon.js | Updated documentation and fixed minor comment typos. |
src/scene/gsplat/gsplat-sogs.js | Removed redundant texture parameters and updated parameter passing. |
src/scene/gsplat/gsplat-sogs-data.js | Added new GPU reordering logic based on Morton order for improved cache coherency. |
src/scene/gsplat/gsplat-data.js | Clamped coordinate values to a maximum of 1023 to prevent potential overflows. |
src/framework/parsers/sogs.js | Updated texture async reads and adjusted texture assignments for the new data layout. |
src/scene/gsplat/gsplat-sogs-data.js
Outdated
targetTexture.name = `sogs-${member}`; | ||
targetTexture._levels = sourceTexture._levels; | ||
this[member] = targetTexture; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding an inline comment to explain the texture swap logic in this loop, clarifying how the chain of render targets is being updated for maintainability.
// Swap targetTexture and sourceTexture to prepare for the next iteration. |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WGSL chunks need to be updated as well, otherwise this won't work on WebGPU
Also, it'd be great to have an engine example using this, so that we can test both platforms easily. |
There is some remaining follow up work:
|
If the rendering is done by reading from textures, then there might be a significant performance reduction when accessing texture texels at random positions. As it does not allow GPU to cache chunks of it, so the reads from it will require a slow memory trips. |
@Maksims , yep, that's what this PR is addressing :) |
Fixes #7537
This PR updates SOGS runtime as follows:
SOGS Data Comparison
Examples of SOGS compression. All scenes contain 3 bands of spherical harmonics.
Notes