-
Notifications
You must be signed in to change notification settings - Fork 7
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
Multiple raster overlays cleanup #495
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pointed out some bug fixes that were included in this PR
return fabricMesh.material != nullptr && fabricMesh.material->getMaterialDefinition().hasBaseColorTexture() && | ||
fabricMesh.materialInfo.baseColorTexture.has_value(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug fix. The nullptr
check prevents against a crash if you're using a custom tileset material in #406 but omniverse can't locate it (the full explanation for why this happens is a bit longer).
@@ -410,7 +407,7 @@ void FabricMaterial::setTextureValues( | |||
const TextureInfo& textureInfo, | |||
uint64_t texcoordIndex) { | |||
|
|||
if (texcoordIndex >= FabricTokens::MAX_TEXTURE_LAYER_COUNT) { | |||
if (texcoordIndex >= FabricTokens::MAX_PRIMVAR_ST_COUNT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug fix, was using the wrong constant.
gltf_texture_lookup_value imagery_layer_0 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_1 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_2 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_3 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_4 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_5 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_6 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_7 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_8 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_9 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_10 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_11 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_12 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_13 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_14 = gltf_texture_lookup(), | ||
gltf_texture_lookup_value imagery_layer_15 = gltf_texture_lookup() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should actually by gltf_texture_lookup_value()
. It's harmless for now, but I fixed it on a different branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and I forgot to mention in the PR description, eAsset
arrays don't seem to work in Fabric which is why each texture is its own entry instead of gltf_texture_lookup_value[16]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't spent much time with OV materials yet, but this all makes sense and LGTM.
As I was integrating multiple raster overlays (#492) into tileset material nodes (#406) I realized it would be much simpler to treat glTF base color textures and raster overlays as separate things instead of all being treated as base color textures.
The main change is in
cesium.mdl
wherecesium_imagery_layer_resolver
is responsible for blending imagery layers together andcesium_material
is responsible for blending the final imagery layer color with the glTF base color texture. As a resultcesium_material
is no longer an exact copy ofgltf_material
, but does some simple calculations first.In the case where there's a single imagery layer performance should still be good because it skips
cesium_imagery_layer_resolver
.