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

Update GS rendering v2.0 #6357

Merged
merged 6 commits into from May 15, 2024
Merged

Update GS rendering v2.0 #6357

merged 6 commits into from May 15, 2024

Conversation

slimbuck
Copy link
Member

@slimbuck slimbuck commented May 13, 2024

Having done more profiling, it seems that the order of splat data is by far the most important element when rendering large GS scenes on GPU.

Therefore this PR supersedes #6352: it takes the best parts, but without the additional memory requirements of the preprocess step.

Before:
Screenshot 2024-05-10 at 16 07 53

After:
Screenshot 2024-05-10 at 16 08 24

So, this PR:

  • Uploads splat order data to texture instead of uploading duplicate vertex data.
  • Renders splats by instancing a 128-quad mesh.
  • Refrains from rendering splats behind the camera.
  • Reorder uncompressed data at startup to match compressed format.
  • Default to half float for storing uncompressed data.

Issues:

  • reordering millions of splats at load time is not fast. For fast load time, use the compressed format. (We will investigate improving reorder performance in future)
  • we might want to expose a load-time option for users to disable splat reorder on load

Next steps:

  • Implement rendering directly from compressed format. This will cut runtime memory usage 4x.

@slimbuck slimbuck mentioned this pull request May 13, 2024
Co-authored-by: Will Eastcott <willeastcott@gmail.com>
Copy link

vercel bot commented May 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
engine ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 9:52am

// number of quads to combine into a single instance. this is to increase occupancy
// in the vertex shader.
const splatInstanceSize = 128;
const numSplats = Math.ceil(splat.numSplats / splatInstanceSize) * splatInstanceSize;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use math.roundUp

@slimbuck slimbuck merged commit 614aedb into playcanvas:main May 15, 2024
8 of 9 checks passed
@slimbuck slimbuck deleted the gs-take-two branch May 15, 2024 09:51
slimbuck added a commit to slimbuck/engine that referenced this pull request May 20, 2024
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.

None yet

3 participants