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

Add support for UINT8-based property textures in CustomShader #10247

Merged
merged 13 commits into from
Mar 31, 2022

Conversation

ptrgags
Copy link
Contributor

@ptrgags ptrgags commented Mar 30, 2022

This PR finishes what #10073 started; it implements the basics of property textures (see the EXT_structural_metadata spec) in CustomShader.

Parsing metadata in the shader is rather involved due to type conversions and WebGL 1 limitations. So this PR only implements the following types which are the easiest to represent in texture form:

  • SCALAR UINT8 (normalized) -- these become float in the shader
  • SCALAR UINT8 -- these become int in the shader since WebGL 1 doesn't support uint
  • VEC2/3/4 UINT8 (normalized) -- these become vec2/3/4 in the shader. These are parsed from multiple texture channels.
  • VEC2/3/4 UINT8 -- these become ivec2/3/4 in the shader. These are parsed from multiple texture channels.
  • fixed-size array of UINT8 (normalized and unnormalized) with 2-4 components -- these become the most appropriate vector type as described in the previous 2 bullets.

Though the spec supports several more types (e.g. a UINT16 spread across two texture channels), those will be handled in future PRs.

Sandcastle for testing

To Do:

@cesium-concierge
Copy link

Thanks for the pull request @ptrgags!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.

@ptrgags ptrgags requested a review from lilleyse March 30, 2022 18:59
@ptrgags
Copy link
Contributor Author

ptrgags commented Mar 30, 2022

Okay this is ready, @lilleyse could you review?

@lilleyse
Copy link
Contributor

Could you add a new Sandcastle example based on https://demos.cesium.com/owt-uncertainty minus the picking functionality?

@ptrgags
Copy link
Contributor Author

ptrgags commented Mar 31, 2022

@lilleyse added the sandcastle, this is ready for review again

@ptrgags
Copy link
Contributor Author

ptrgags commented Mar 31, 2022

@lilleyse updated!

@lilleyse lilleyse merged commit e452c92 into main Mar 31, 2022
@lilleyse lilleyse deleted the property-textures-take-two branch March 31, 2022 13:09
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.

3 participants