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

GPM sandcastle #12232

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

GPM sandcastle #12232

wants to merge 1 commit into from

Conversation

javagl
Copy link
Contributor

@javagl javagl commented Oct 5, 2024

Description

Support for the NGA_gpm_local extension has recently been added to Cesium JS, via #12204. This (indirectly) includes the possibility to pick metadata values from the GPM PPE (Per-Point Error) textures, by treating them as property textures and apply metadata picking.

This PR adds a Sandcastle that demonstrates the GPM visualization.

For now, this Sandcastle is in the /Development section, but can easily be moved elsewhere. It includes the option to visualize property texture values, and therefore might eventually replace https://sandcastle.cesium.com/index.html?src=Custom%20Shaders%20Property%20Textures.html

The current state is a draft. It already replicates most of the functionality from an existing demo. But unfortunately, there seems to be an issue that is related to scaling and picking the metadata values from property textures for this data set: The picking functionality currently returns wrong values. The reason for this still has to be investigated.

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

Copy link

github-actions bot commented Oct 5, 2024

Thank you for the pull request, @javagl!

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

@lilleyse
Copy link
Contributor

lilleyse commented Oct 5, 2024

For now, this Sandcastle is in the /Development section, but can easily be moved elsewhere

I think the 3D Tiles folder would be better, more visible and easier to access from sandcastle.cesium.com.

@javagl
Copy link
Contributor Author

javagl commented Oct 5, 2024

I can move it there with the next update.

About the wrong metadata values:

This is related to the handling of offset/scale. The ppeTexture contains offset/scale. And there is no concept of normalized in the PPE Textures. But when translated to property textures, they have to be normalized in order to even be able to apply offset/scale. So in the property texture, normalized has to be set to true, and then taken into account in the scale factor. This was anticipated in the GPM part (EDIT: Fixed link). But on the metadata picking side, every normalized/offset/scale basically has to be "undone", to fully exploit the 256 values of the picking frame buffer. Right now, it only took normalized into account, but it essentially has to do what apply/unapplyValueTransform are doing. Things might become more tricky for more complex cases, where the 'class property' defines some offset/scale, and the 'property texture property' overrides the offset/scale. Care has to be taken to get the forward- and backward conversions right...

I do have a fix for that locally that "works" for the GPM data. But I'd like to test (and describe/document!) it more thoroughly.

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.

2 participants