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

Dynamic material support in Fabric #242

Closed
lilleyse opened this issue Mar 22, 2023 · 0 comments · Fixed by #384
Closed

Dynamic material support in Fabric #242

lilleyse opened this issue Mar 22, 2023 · 0 comments · Fixed by #384

Comments

@lilleyse
Copy link
Contributor

As of Kit 104.2 it's not possible to update material attributes (including textures) after the material is created or assign new materials to existing prims. So we are stuck with the originally assigned material and any sort of dynamic updates are not possible.

Currently our workaround is to destroy the existing prim whenever material changes happen, e.g. when higher res imagery is attached to the tile.

if (pTileRenderResources->geomPaths.size() > 0) {
// Already created the tile with lower-res imagery.
// Due to Kit 104.2 material limitations, we can't update the texture or assign a new material to the prim.
// But we can delete the existing prim and create a new prim.
FabricStageUtil::removeTile(pTileRenderResources->allPrimPaths, pTileRenderResources->textureAssetNames);
}

Once dynamic material updates are supported in Kit, it unlocks several improvements for us:

  • No longer need to destroy prims when higher res imagery is attached to the tile
  • Mesh and material pooling becomes possible
  • Makes it easier to implement multiple raster overlays: Support for multiple raster overlays #84

CC #169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant