Material for a b3dm tiles

Hi,
I transformed CityGML with FME into the b3dm format and I want to change the Material definition for the b3dm tiles. Is there a way to change the material of the features like the changing of the color with the Cesium3DTileStyle?

The b3dm files have a material definition in the gltf JSON. Swapping the material there is working.

"materials":[{"name":"default_material","pbrMetallicRoughness":{"baseColorFactor":[0.8,0.8,0.8,1],"roughnessFactor":0.30000000000000004,"metallicFactor":0.5}}]
grafik

"materials":[{"name":"default_material","pbrMetallicRoughness":{"baseColorFactor":[1.0,0.7,0.3,1],"roughnessFactor":0.00000000000000000,"metallicFactor":1.0}}]

grafik

Is there a way without touching the b3dm files and specify it via CesiumJS?

I am using:

  • Cesium 1.69.0
  • Windows 10
  • Firefox 79.0

CesiumJS doesn’t support dynamically changing the material in 3D Tiles (like changing roughness/metallic factors), although you can use the 3D Tiles styling language to change color and opacity like in this code example: https://sandcastle.cesium.com/index.html?src=3D%20Tiles%20Feature%20Styling.html.