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

Tileset rendering does not work correctly with a Dynamic Material Instance #1569

Open
kring opened this issue Dec 12, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@kring
Copy link
Member

kring commented Dec 12, 2024

Reported here:
https://community.cesium.com/t/cesium-for-unreal-3dtiles-dynamicmaterial/37034

To reproduce, create a Level Blueprint like this:
https://blueprintue.com/blueprint/oyczy--l/
image

Click Play-in-Editor, and the tileset will render, but it will be missing its raster overlays (among other things).

The reason is that the new material doesn't have UCesiumMaterialUserData attached to it, so it doesn't know the mapping between material layer name (such as Overlay0) and the material layer index used to set material parameters. Adding UCesiumMaterialUserData is not an option, because the API necessary to find the layer names is only available in the Editor.

The best solution, I think, is to modify the code starting here:
https://github.com/CesiumGS/cesium-unreal/blob/v2.11.0/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp#L3024
So that, rather than just checking the pBaseAsMaterialInstance for UCesiumMaterialUserData, it also walks the Parent chain looking for a parent material that has it.

@kring kring added the bug Something isn't working label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant