CesiumGS / cesium-native

Apache License 2.0
414 stars 210 forks source link

Support texture transform extension on occlusion and normal textures. #799

Closed kring closed 7 months ago

kring commented 7 months ago

These two texture types have custom classes, MaterialOcclusionTextureInfo and MaterialNormalTextureInfo, but the KHR_texture_transform extension was configured to only apply to TextureInfo classes. The custom classes are derived from TextureInfo, but the code generator isn't that clever.

The end result was that instances of KHR_texture_transform attached to an occlusion or normal texture showed up as an unknown extension (expressed as a JsonValue) rather than as ExtensionKhrTextureTransform.

j9liu commented 7 months ago

Thanks @kring !

lilleyse commented 7 months ago

I think this is also needed for FeatureIdTexture and PropertyTextureProperty, which also subclass TextureInfo.

j9liu commented 7 months ago

Good catch @lilleyse. That probably means that FeatureIdTextureView and PropertyTexturePropertyView need to store the extension values, too, and apply them to the input UV coordinates.