Skip to content
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

Splat shader #12364

Draft
wants to merge 99 commits into
base: main
Choose a base branch
from
Draft

Splat shader #12364

wants to merge 99 commits into from

Conversation

keyboardspecialist
Copy link

@keyboardspecialist keyboardspecialist commented Dec 6, 2024

Description

Opening as a draft as some things are still in progress, and this is a long running feature branch.

This adds support for rendering Gaussian splats from 3D Tiles 1.1 using a proposed draft extension here

description in progress

PixelFormat, PixelDatatype - Support added for integer textures with pixel formats R32UI/R32I, RG32UI/RG32I, RGB32UI/RGB32I.

GaussianSplatPipelineStage - This is the old pipeline. May be removed in the future, but doesn't rely on any web assembly.

GaussianSplatTexturePipelineStage - New pipeline. Renders from an attribute texture. Uses web assembly for texture generation and sorting the indexes for retrieving attributes from the texture. Texture format is RGBAUI.

Both use PrimitiveLoadPlan to prep their attributes. The only pipeline simply uses this to keep attributes in CPU memory, so they can sorted later. The new pipeline generates it's texture here, and inserts an index attribute to read from that texture.

GeometryPipelineStage - This is where we determine if we are actually rendering splats. Since we use a point primitive in the glTF we can switch between them at runtime. If disabled, we follow the point cloud pipeline as usual.

Model.js - Sorting updates occur here. We check for camera movement then sort and rebuild the command list.

Model, Cesium3DTileStyle - Styling for scale and toggling splats/point rendering

TODO

  • GaussianSplatTextureGenerator - Needs to be moved to using TaskProcessor.
  • Configuration to use @cesium/wasm-utils once published

Issue number and link

Testing plan

TBD. Will include a sandcastle.

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

interesting scaling decomposed covariance
fragment shader impl
need to get instanced drawarrays working
…loading.

Setup for instanced rendering of quads
Attempting to fix splat scaling
new uniforms for camera data, no more computing in vertex shader

renamed splat stage define
correctly uses viewProjection when sorting
shader tweaks
@ggetz
Copy link
Contributor

ggetz commented Jan 27, 2025

Thanks for all the updates here @keyboardspecialist!

What is the current status of this PR and where can we help with reviews?

  • Is the code ready for another review pass?
  • What is the status of unit tests?
  • What does a testing plan look like for us to confirm functionality?
  • Is the inline documentation up to date?
  • Has GaussianSplatTextureGenerator been updated as per the TODO list item?

… for splats

vertex shader tweaked to account for transform scale when calculating 2d covariance
…on moved to Model from PrimitiveLoadPlan (where is was synchronous)..

Reworked logic in runtime primitive. No longer auto fallback to other pipeline.
@keyboardspecialist
Copy link
Author

Thanks for all the updates here @keyboardspecialist!

What is the current status of this PR and where can we help with reviews?

  • Is the code ready for another review pass?
  • What is the status of unit tests?
  • What does a testing plan look like for us to confirm functionality?
  • Is the inline documentation up to date?
  • Has GaussianSplatTextureGenerator been updated as per the TODO list item?
  • Code is ready for another pass
  • Unit tests are being wrapped up
  • I'm putting together some simple assets for tests, compressed and uncompressed. It's using the model pipeline, so it's mainly checking that it's loading the glTF correctly and setting the pipeline state.
  • Documentation in progress
  • Yes, all code changes are complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants