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 updates #5808

Merged
merged 6 commits into from Nov 9, 2023
Merged

Splat updates #5808

merged 6 commits into from Nov 9, 2023

Conversation

slimbuck
Copy link
Member

@slimbuck slimbuck commented Nov 8, 2023

This is a followup PR to #5785 and adds a few bits required in SuperSplat:

  • export a few more interfaces
  • fix for camera sorting with modelView matrix
  • early out sort when camera hasn't moved in webworker
  • remove tiny splats, helps with very large scenes like garden.ply
  • add updated event to sorter so editors can re-draw the scene even when camera is static

@slimbuck slimbuck added the area: graphics Graphics related issue label Nov 8, 2023
@slimbuck slimbuck requested a review from a team November 8, 2023 21:48
@slimbuck slimbuck self-assigned this Nov 8, 2023
@@ -163,7 +188,10 @@ class SplatSorter {
data: oldData
}, [oldData]);

this.vertexBuffer.setData(newData);
setTimeout(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering why the setTimeout is required...

Copy link
Member Author

Choose a reason for hiding this comment

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

Without the setTimeout, the postMessage above will only be enqueued after setData has finished executing (setData can be slooow). With the setTimeout, postMessage is sent immediately and the worker can start sorting for the next round while setData completes.

I've confirmed this using Chrome profiler, but it's possible we can do better.

Copy link
Contributor

Choose a reason for hiding this comment

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

Worthy of a comment in the code?

@slimbuck slimbuck merged commit ae88105 into playcanvas:main Nov 9, 2023
7 checks passed
@slimbuck slimbuck deleted the splat-updates branch November 9, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants