# Metadata GLTF2.0 in Cesium 2.7.0

**URL:** <https://community.cesium.com/t/metadata-gltf2-0-in-cesium-2-7-0/34176>\
**Category:** Cesium for Unreal\
**Created:** [July 30, 2024, 8:59am UTC](https://community.cesium.com/t/metadata-gltf2-0-in-cesium-2-7-0/34176 "2024-07-30T08:59:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.kwiatkowski](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/m.kwiatkowski/32/14000_2.png) [@m.kwiatkowski](https://community.cesium.com/u/m.kwiatkowski)\
**Post date:** [July 30, 2024, 8:59am UTC](https://community.cesium.com/t/metadata-gltf2-0-in-cesium-2-7-0/34176/1 "2024-07-30T08:59:34Z")

</div>

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:

> [@glTF2.0 in UE5.2, metadata "EXT\_structural\_metadata", "EXT\_mesh\_features"](https://community.cesium.com/t/gltf2-0-in-ue5-2-metadata-ext-structural-metadata-ext-mesh-features/26873/12):
>
> Now trying to find a working example in UE with EXT\_mesh\_gpu\_instancing. Just wanted to give a headsup that EXT\_mesh\_gpu\_instancing is not currently supported in Cesium for Unreal. There was a [Github PR](https://github.com/CesiumGS/cesium-unreal/pull/560) to add support, but it has not had any updates in years, and we don’t have a time estimate for when we will properly address it. Apologies for the inconvenience.

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:

 ![image](https://global.discourse-cdn.com/cesium/original/3X/3/8/38d7947c9892d0bdc003fc10174cb58c12f58ced.png)  
Here is print with Log:  
 ![image](https://global.discourse-cdn.com/cesium/original/3X/c/6/c672c98016122f907d4ec40cd1a34a5022284d39.jpeg)  
Attribute Table works fine:  
 ![image](https://global.discourse-cdn.com/cesium/original/3X/1/0/10b594bcd79f5704df7702d7542f042b5f3d6f53.jpeg)

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?

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [August 2, 2024, 3:31am UTC](https://community.cesium.com/t/metadata-gltf2-0-in-cesium-2-7-0/34176/2 "2024-08-02T03:31:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![m.kwiatkowski](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/m.kwiatkowski/32/14000_2.png) [@m.kwiatkowski](https://community.cesium.com/u/m.kwiatkowski)\
**Post date:** [August 2, 2024, 6:18am UTC](https://community.cesium.com/t/metadata-gltf2-0-in-cesium-2-7-0/34176/3 "2024-08-02T06:18:35Z")

</div>

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

 ![image](https://global.discourse-cdn.com/cesium/original/3X/0/0/008415c045774bdf07386796a64f8f581b095bc1.png)

My Test example.  
[baza\_L12X2263Y1642\_building.zip](https://community.cesium.com/uploads/short-url/hftNAO8ru9NRRfKXSfIIUg3SMYs.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:

 ![image](https://global.discourse-cdn.com/cesium/original/3X/f/0/f0b228ed6fcaa1baf1b3326c6a24d46b13ebe380.jpeg)

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

 ![image](https://global.discourse-cdn.com/cesium/original/3X/9/e/9e28b603ecda2e52b03550572a25bd5d42c3bd4e.jpeg)

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

 ![image](https://global.discourse-cdn.com/cesium/original/3X/9/6/961dceb30d8d34c5f1ee986d637cde5df9659cb6.jpeg)  
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:

 ![image](https://global.discourse-cdn.com/cesium/original/3X/f/b/fbdea732d5610600ff9fb93bc3133c623c1b7ea9.jpeg)

This metadata works fine in Cesium 1.31 and 2.0.

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [August 2, 2024, 6:37am UTC](https://community.cesium.com/t/metadata-gltf2-0-in-cesium-2-7-0/34176/4 "2024-08-02T06:37:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![m.kwiatkowski](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/m.kwiatkowski/32/14000_2.png) [@m.kwiatkowski](https://community.cesium.com/u/m.kwiatkowski)\
**Post date:** [August 2, 2024, 8:05am UTC](https://community.cesium.com/t/metadata-gltf2-0-in-cesium-2-7-0/34176/5 "2024-08-02T08:05:33Z")

</div>

How I add this metadata in Ceisum 2.7

1. Add CesiumFeaturesMetadata to Tileset:  
 ![image](https://global.discourse-cdn.com/cesium/original/3X/5/4/54d01d3b369bc0133f4fd412bb3fc4b28c0c9e94.png)
2. Refresh model:  
 ![image](https://global.discourse-cdn.com/cesium/original/3X/0/e/0e31aff14b3e7671ec05f5c9f6240dfb1afec404.png)
3. Click Auto Fill:  
 ![image](https://global.discourse-cdn.com/cesium/original/3X/7/7/7746a979ffb412f1c2af3061d660705c3c9fa147.png)
4. Check Property Tables:  
 ![image](https://global.discourse-cdn.com/cesium/original/3X/4/c/4ccf85f3308d6887d60d181aad002d03fd596643.png)
5. Generate Material:  
 ![image](https://global.discourse-cdn.com/cesium/original/3X/c/4/c4562670491a0f21b8bea9846c9d913f5fba28b5.png)

Probable problem is here, becouse it is new:

 ![image](https://global.discourse-cdn.com/cesium/original/3X/d/a/dae42cfddd5ac34261b4ff18769dcd1b73005210.png)

In **Cesium 1.31** looks diffrent:

 ![image](https://global.discourse-cdn.com/cesium/original/3X/8/a/8a5d48d770f7a6e6041c75ac72e2afe5eda819bc.png)

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [August 2, 2024, 9:00am UTC](https://community.cesium.com/t/metadata-gltf2-0-in-cesium-2-7-0/34176/6 "2024-08-02T09:00:36Z")

</div>

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

 ![image](https://global.discourse-cdn.com/cesium/original/3X/0/3/037aa8a2ba3c386a33cad5010b6ff2426450781e.png)

And I get a view like this:

 ![image](https://global.discourse-cdn.com/cesium/original/3X/9/6/9652acb45062f35baab8ef6999500d0e7063432a.jpeg)

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:

 ![image](https://global.discourse-cdn.com/cesium/original/3X/d/8/d82179fb141c5e05ff32294c48f7197df29a8a25.png)

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:

 ![image](https://global.discourse-cdn.com/cesium/original/3X/2/1/2115873c65bdeba54ba449789d2a5103a54d8263.png)

 ![image](https://global.discourse-cdn.com/cesium/original/3X/0/e/0e68b08bf23ee7e2c4baf56948d178887077b617.png)

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.

---

<div class="post-metadata">

**Author:** ![m.kwiatkowski](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/m.kwiatkowski/32/14000_2.png) [@m.kwiatkowski](https://community.cesium.com/u/m.kwiatkowski)\
**Post date:** [August 2, 2024, 10:47am UTC](https://community.cesium.com/t/metadata-gltf2-0-in-cesium-2-7-0/34176/7 "2024-08-02T10:47:02Z")

</div>

THX ! Here is problem:  
 ![image](https://global.discourse-cdn.com/cesium/original/3X/8/5/85d870b14620e8b0f6ed34b8f56bae3ec3c7235c.png)  
I use Metadata, in new version is FeaturesMetadata!

Now all works fine! Thx again
