Metadata GLTF2.0 in Cesium 2.7.0

I’m trying to migrate my buldings with Metadata to UE5.4 and Cesium 2.7.0, but Property tabel in Shader gets strange numbers.

All works fine in Cesium 2.0. I tested it here:

Test model have 3 Box 0,1,2:

ID Cesium#Height elemntID
0 10 0
1 30 1
2 50 2

estimate#Height is Flot32
elemttID is Int32

The metadata is 100% good, because I can list it using linetrace:


Here is print with Log:

Attribute Table works fine:

unfortunately my metadata cesium#height and elementID give strange values in Shader.

My queastion is:

  1. How to correctly transfer values ​​from metadata to the shader in Cesium 2.7.0?
  2. Is this a bug or maybe I need to set something in the new cesium?

If I’m reading your material graph correctly, it’s setting the Base Color to “red” when the Feature ID is zero, and to “black” otherwise. And that is what I see in the Result screenshot as well (assuming the smallest pillar has a feature ID of zero). Can you elaborate on what problem you’re seeing?

the problem is with the metadata, but only in shader.

My Test example.
baza_L12X2263Y1642_building.zip (546.8 KB)

I created buildings with metadata in LAT: 54,336922 LNG: 18,939122.
Metadata Name:

“ETC#estimatedHeight” - float 32 , “ETC#typeBuldings” - uint8, “ETC#material”- uint8, “ETC#IDtexture”- uint8

this metadata are connected to the attribute table (Feature ID).
In my case Feature ID even are walls. Feature ID odd are roof. All roofs have ETC#estimatedHeight = 0.

When I try to highlight all meshes whose height is 0 (all flat roofs), I get nothing:

But when I try highlight all roof from Feature ID (all roof are odd), all works fine:

But in ETC#estimatedHeight are random number. Look this example:


some roofs are red even though all roofs have the same value of 0.

When I use linetrace, all metadata are correct. When I hit in roof my log:

This metadata works fine in Cesium 1.31 and 2.0.

Can you please share how you’ve configured the metadata component on the tileset?

How I add this metadata in Ceisum 2.7

  1. Add CesiumFeaturesMetadata to Tileset:
  2. Refresh model:
    image
  3. Click Auto Fill:
    image
  4. Check Property Tables:
  5. Generate Material:
    image

Probable problem is here, becouse it is new:

In Cesium 1.31 looks diffrent:

I’m using your tileset, and trying to reproduce the problem you’re seeing. I set up my material layer like this:

And I get a view like this:

Which I think is behaving correctly. The roofs all have an estimated height of 0.0, so they’re red, while the walls have various values greater than 0.2 so they’re black.

I didn’t change any of the metadata component values from their defaults after the Auto Fill. The estimated height property looks like this:

If that all seems right so far, but it isn’t working for you, maybe it’s worth checking out how you set up your material. Mine looks like this:

It’s very important that the top material layer be named exactly FeaturesMetadata. I don’t think that would cause the seemingly random values that you’re seeing, but it’s worth checking.

THX ! Here is problem:
image
I use Metadata, in new version is FeaturesMetadata!

Now all works fine! Thx again

1 Like