Skip to content

Conversation

@keyboardspecialist
Copy link
Contributor

@keyboardspecialist keyboardspecialist commented Jun 30, 2025

Description

Tileset modelMatrix transforms were not being applied correctly to the Gaussian splat tilesets. Previously it was using ENU-based when transforming child tiles and building the draw command. This update changes it to use the root tileset transform and tileset modelMatrix in both cases.

A visual of the problem compounding, spiraling the asset into space
spiral

With these updates, we see proper handling of rotations

mmfix.mp4

GaussianSplat3DTileContent

  • All tiles including root get transformed
  • Tracks original position, scale, and rotation values. transformations only occur using these values to prevent transformations stacking

GaussianSplatPrimitive

  • transformTile uses the root transform and tileset modelMatrix rather than ENU-based transform.
  • buildGSplatDrawCommand follows this now as well for creating the drawCommand modelMatrix
  • checks for tileset modelMatrix changes and marks itself dirty

Issue number and link

Fixes issue #12705

Testing plan

A sample asset with a known geolocation was loaded into sandcastle. Rotation and translation transforms were then applied to the tileset modelMatrix.

Test 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

- All tiles including root get transformed
- Tracks original position, scale, and rotation values. transformations only occur using these values to prevent transformations stacking

GaussianSplatPrimitive
- transformTile uses the root transform and tileset modelMatrix rather than ENU-based transform.
- buildGSplatDrawCommand follows this now as well for creating the drawCommand modelMatrix
- checks for tileset modelMatrix changes and marks itself dirty
@keyboardspecialist keyboardspecialist linked an issue Jun 30, 2025 that may be closed by this pull request
@github-actions
Copy link

Thank you for the pull request, @keyboardspecialist!

✅ We can confirm we have a CLA on file for you.

@keyboardspecialist keyboardspecialist marked this pull request as ready for review June 30, 2025 23:51
@weegeekps weegeekps requested a review from jjspace July 1, 2025 02:03
Copy link
Contributor

@weegeekps weegeekps left a comment

Choose a reason for hiding this comment

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

Seems like a good enough fix. @jjspace needs to be the final reviewer since he is handling the release tomorrow.

@javagl
Copy link
Contributor

javagl commented Jul 1, 2025

For convenience: The test sandcastle including the Sandcastle UI:

https://ci-builds.cesium.com/cesium/gsplat-modelmatrix-update/Apps/Sandcastle/index.html#c=xVdRb9s2EP4rhPdQGVCkJPaGzXWNNWkHBFiSoXa7SPALJdE2EYoUSMqOO/i/7yhKtmQrcZAg7UMQHo9333cfSR0dC640WlKyIhJ9QJys0CVRNE+9b8WcM+3EhX0puMaUEzntuOi/KUdIEylhZlAFTKztzaRI/xWSJeWE03WnfNN9P+VTHhdwmjKiiAY8C+ypmHDiZZKmVNMlUR5OEsdg4BWmugKw/3qfJja8ALoS/KMC4ypxev1+74/z05IdQgmJ8vl4IVaGOuH6QuQ8oXz+TbA8JQOkZU5cs3TTnXJLr6TzXYh0IpySpnX5PhpjnsRYaUbQ1ysEnjyrKjKB1yIhDGoq4DGfM/KJzO8G6NStTwT7E2E1oWLMCKw/21lBwwqttan4fM0SrAnSC4JSg32NtaQPSMyKqZK9iyKsSIIEL2YNUbt6ymc5jzUFR14kKmW93qVyurYYW+O2JKjxJk8jOBzbsr2t06i1HxE8FRG0RYRPRYQHEV9wYliV5wTILzwtYJJirpzHqcGK4GhY0BYWHg0L7bGpAuGA6+KGldviReVpHGcLIoln/Y0QLW4lnVPegIJd6RcHfyIBjWGzf44979UtwVLDCPOex8kc9tWxud365d4tcrpdE14v0qR/LrTN3axVCl04bcxdbz9Lr8jypVx1V9LfbqRr7RrbMsw5YNpECo4gBXtIwYuRwiNI4R5S+AykQ6y7oA0nzZmmGVs3d/0RLzog7rY7gp3jMZJAs1yzv8Ev0BFqaz9clYROXYWmPoIltY/UYZqrT59vJleT4D3y/eq61T6QrVqrwzR7Uu5uhduifG15jbi7vcTuoTp9uHqPKddvngvfN2wFIx4Tc2jJN2KFTB+uVWVFbin3aGFNOfe2WD2D4absR5eYMeg0qwXZ7zUoXsBVIOqg5xTAf4Gy5rVRtZvH21ENbJxHKpY0gkYnDjpbyfSei/he5NrTEsf3u05i8lTfWMEibL7LiYjhVcC1Nyf6MyNmeLGGV8W0U66ZdkzYfmacgZAXtPiUqx2CW2U2MTMhkWPxOE4Jgu/qjootmc5QrdEtsLpd8X+kyIjUa8cEdbvVs2aPQXVrDe/bSBG5xBEjdSZF+HaZqnRzWnbAHqJNqfKT+9BxO0Ol14yMTMifNM2E1CiXzPE8X5M0gwZBlB/l8T2cx1gpm/uXSvGymgg2Zi5NLxwgOY+w0z93UfV36v1uoxDK4EUIEg9QP3sopyIhEyJPJDTeXO0cmwYM5VmuK7AlyEnhJXWCGZ3DwzWlScJIE+FEi2yAzrco1XQktBbpzgMwQ78SYJjQJaLJh5bHMooZVgo8s5yxMf1Opp3R0If1jTAmsEG5BYYMr82Sxdnobzvped7QB/Mwansyiz0YarPzI0t7qCORrEfVtg+13I6NlYw+Vq+ioQ9W07ezwLYK6nVGAFGaawxFpZSDdWpG+AFGvd/MWGmSgXEGQzg5+CSCewH2ErMc3tvbd5iLihn7fB2gdwXCu7KKdlxNHrQBAP3A+vUIQCNVoz4w5DNECX64KMFbixK8WpTwh4sSvrUo4YtFGRc/1l6jiHd6thXlrKZJ6WhhbX8gvpUmNvvrBAl+giDBmwoSvE6Q8CcIEr6pIM+7MjDc9h8Yl42p6mD/Aw

(This was omitted in the posted link)

@javagl
Copy link
Contributor

javagl commented Jul 1, 2025

Aaannnd with the rotation (and scaling) being applied in local space....

https://ci-builds.cesium.com/cesium/gsplat-modelmatrix-update/Apps/Sandcastle/index.html#c=xVZtb9s2EP4rhPehMqDISewNm+saa9IOCLA0Q+J2kaAvlETbRChSoCg77uD/vqNI2bIsO0GCtB8M68i7e557+Hax4LlCC0qWRKIPiJMluiQ5LVLvWznmhJ24tC8FV5hyIsOOi/4LOUKKSAkjwypgYmxvKkX6r5AssQNO1w35uvs+5CGPSzhFGcmJAjwD7OUx4cTLJE2poguSezhJHI2Bl5iqCsD89T9NTHgJdCX4xxyMq8TpDwb9P85PLTuEEhIVs7u5WGrqhKsLUfCE8tk3wYqUDJGSBXG167obckPP0vkuRD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mtBbZRUK0yAohSH2MoKqUcrFP9hR/hq/+b/s4VycA4g0/YOfgkgnMB9gKzArr0Td/jonLEtItD9K5EeGeraMdV5FFpANAPrF+fANhJtVMfGPIZovg/XBT/rUXxXy1K8MNFCd5alODFopSNw6vOjnd6thHlrKaJnWhhXbUib6OJyf46QfyfIIj/poL4rxMk+AmCBG8qyPOODHxu3h/4tg9T9YL9Dw

@ggetz
Copy link
Contributor

ggetz commented Jul 1, 2025

Thanks @keyboardspecialist! The code changes here look good to me (and are isolated enough that risk for today's release is low).

However, I just tested the sandcastle from the original issue(#12705) in this branch, and I don't see any change in behavior. Should there be? I want to confirm this fixes the reported issue.

@jjspace
Copy link
Contributor

jjspace commented Jul 1, 2025

Things look pretty good from a quick test.
I noticed that the Scale sliders don't do anything in the "world space" example sandcastle but do in the "local space" one. Is this expected?

@keyboardspecialist
Copy link
Contributor Author

keyboardspecialist commented Jul 1, 2025

Things look pretty good from a quick test. I noticed that the Scale sliders don't do anything in the "world space" example sandcastle but do in the "local space" one. Is this expected?

I disabled them as the scope was for translations and rotations. Scaling is a bit more involved since the splats themselves have to be scaled accordingly.

eta: updated the sandcastle for clarity (and added the missing ui elements)

@keyboardspecialist
Copy link
Contributor Author

Thanks @keyboardspecialist! The code changes here look good to me (and are isolated enough that risk for today's release is low).

However, I just tested the sandcastle from the original issue(#12705) in this branch, and I don't see any change in behavior. Should there be? I want to confirm this fixes the reported issue.

That is expected. The problem was two fold: we weren't accounting for the tileset modelMatrix when transforming child tiles and when building the draw command, and we need to apply the rotation in local space to ensure we rotate about the correct origin.

@javagl
Copy link
Contributor

javagl commented Jul 1, 2025

I don't see any change in behavior. Should there be? I want to confirm this fixes the reported issue.

The tileset is rotated by 180 degrees, still ending up in an obscure place on earth. But one difference should be visible:

Cesium Splat Rotation

Without the updates from this branch, the splats have all been messed up after the rotation.

(I also tried that "unit cube" splat from #12682 , and the orange "edge" is still rotated, so I do have some concerns about whether "everything" is "fixed" here, but ... it's probably safe to say that something is fixed)

@ggetz
Copy link
Contributor

ggetz commented Jul 1, 2025

Cool, sounds like this is behaving as expected then.

@jjspace Please merge if you're comfortable with this going into today's release.

@jjspace
Copy link
Contributor

jjspace commented Jul 1, 2025

It seems like everything is working as expected for now so I'm ok to merge this and get it in the release.

I disabled them as the scope was for translations and rotations. Scaling is a bit more involved since the splats themselves have to be scaled accordingly.

@weegeekps If this is something we still want to address please open an issue or include it in #12682

(I also tried that "unit cube" splat from #12682 , and the orange "edge" is still rotated, so I do have some concerns about whether "everything" is "fixed" here, but ... it's probably safe to say that something is fixed)

@javagl Same for you, I think what's here is fine but if you think something else should be done as a follow up please make note of it in an issue so it's tracked.

@jjspace jjspace added this pull request to the merge queue Jul 1, 2025
Merged via the queue into main with commit 0dc7bf8 Jul 1, 2025
9 checks passed
@jjspace jjspace deleted the gsplat-modelmatrix-update branch July 1, 2025 15:33
@javagl
Copy link
Contributor

javagl commented Jul 1, 2025

if you think something else should be done as a follow up please make note of it in an issue so it's tracked.

The follow-up issue at #12682 already mentioned the model matrix (and I added a note there that this was partially addressed). I think that any new, "standalone" issues could/should be pulled out of that only as necessary (so no further action for now)

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.

Gaussian splats not applying modelMatrix correctly

7 participants