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 UINT32, UINT64, INT64 property table properties #614

Open
lilleyse opened this issue Jan 9, 2024 · 0 comments
Open

Add support for UINT32, UINT64, INT64 property table properties #614

lilleyse opened this issue Jan 9, 2024 · 0 comments

Comments

@lilleyse
Copy link
Contributor

lilleyse commented Jan 9, 2024

We didn't add support for UINT32, UINT64, and INT64 properties in #573 due to several limitations:

  • MDL doesn't have uint, uint64, or int64 types, just an int type
  • MDL doesn't support reading from integer textures
  • MDL and DynamicTextureProvider don't support 64-bit texture formats

It would still be valuable to access these properties in MDL, though. One solution is to encode them in a 32-bit float texture and warn the user about potential precision loss, similar to what's done for FLOAT64.

The main changes would include:

  • Allow UINT32, UINT64, and INT64 in MetadataUtil but log warning about precision loss
  • Updates in FabricMaterial for handling type conversions of noData, defaultValue, and maximumValue
  • Potential changes in MetadataUtil::encodePropertyTables and DataType / DataTypeUtil
  • Potential changes in cesium.mdl

The most difficult part will be handling noData, defaultValue, and maximumValue. These may need to be casted to float to match the texture encoding. Is it possible to do this and still use the existing MDL functions cesium_internal_property_table_int_lookup and cesium_internal_property_texture_normalized_int_lookup?

For testing:

A few issues might come up as annoyances during development:

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

No branches or pull requests

2 participants