# Visualize Mesh Features and Metadata

**URL:** <https://community.cesium.com/t/visualize-mesh-features-and-metadata/36031>\
**Category:** Cesium for Unreal\
**Created:** [October 24, 2024, 11:46am UTC](https://community.cesium.com/t/visualize-mesh-features-and-metadata/36031 "2024-10-24T11:46:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicolasNguyen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/nicolasnguyen/32/14037_2.png) [@NicolasNguyen](https://community.cesium.com/u/NicolasNguyen)\
**Post date:** [October 24, 2024, 11:46am UTC](https://community.cesium.com/t/visualize-mesh-features-and-metadata/36031/1 "2024-10-24T11:46:03Z")

</div>

Hello,  
I am trying to follow this guide: [Visualize Mesh Features and Metadata – Cesium](https://cesium.com/learn/unreal/unreal-visualize-metadata/)  
on how to display metadata based on some features of the 3D tile.

As a starting project I took a Cesium ForUnrealSamples with the newest Cesium for Unreal plugin 2.9.0.  
Every thing is going well until connecting the generated material with custom logic to a base color of SetMaterialAttributes.

**Then I got a two separate errors**  
**First error:**  
LogShaderCompilers: Warning: Failed to compile Material /CesiumForUnreal/Materials/M\_CesiumBaseMaterial.M\_CesiumBaseMaterial (MI:/Game/MI\_CesiumThreeOverlaysAndClippingNewYork.MI\_CesiumThreeOverlaysAndClippingNewYork) for platform PCD3D\_SM5, Default Material will be used in game.  
/Engine/Generated/Material.ush:3969:23: error: no matching function for call to ‘LWCSubtract’  
FLWCScalar Local14 = LWCSubtract(Local11, 30.00000000);  
^ ~~~~~~~~~~  
/Engine/Private/LWCOperations.ush:57:12: note: candidate function not viable: no known conversion from ‘literal float’ to ‘FLWCScalar’ for 2nd argument  
FLWCScalar LWCSubtract(float Lhs, FLWCScalar Rhs) { return MakeLWCScalar(- (( Rhs ).Tile), Lhs - Rhs.Offset); }  
^  
/Engine/Private/LWCOperations.ush:58:12: note: candidate function not viable: no known conversion from ‘float’ to ‘FLWCScalar’ for 1st argument  
FLWCScalar LWCSubtract(FLWCScalar Lhs, float Rhs) { return MakeLWCScalar( (( Lhs ).Tile), Lhs.Offset - Rhs); }  
^  
/Engine/Private/LWCOperations.ush:57:13: note: candidate function not viable: no known conversion from ‘literal float’ to ‘FLWCVector2’ for 2nd argument  
FLWCVector2 LWCSubtract(float2 Lhs, FLWCVector2 Rhs) { return MakeLWCVector2(- (( Rhs ).Tile), Lhs - Rhs.Offset); }  
^  
/Engine/Private/LWCOperations.ush:58:13: note: candidate function not viable: no known conversion from ‘float’ to ‘FLWCVector2’ for 1st argument  
FLWCVector2 LWCSubtract(FLWCVector2 Lhs, float2 Rhs) { return MakeLWCVector2( (( Lhs ).Tile), Lhs.Offset - Rhs); }  
^  
/Engine/Private/LWCOperations.ush:57:13: note: candidate function not viable: no known conversion from ‘literal float’ to ‘FLWCVector3’ for 2nd argument  
FLWCVector3 LWCSubtract(float3 Lhs, FLWCVector3 Rhs) { return MakeLWCVector3(- (( Rhs ).Tile), Lhs - Rhs.Offset); }  
^  
/Engine/Private/LWCOperations.ush:58:13: note: candidate function not viable: no known conversion from ‘float’ to ‘FLWCVector3’ for 1st argument  
FLWCVector3 LWCSubtract(FLWCVector3 Lhs, float3 Rhs) { return MakeLWCVector3( (( Lhs ).Tile), Lhs.Offset - Rhs); }  
^  
/Engine/Private/LWCOperations.ush:57:13: note: candidate function not viable: no known conversion from ‘literal float’ to ‘FLWCVector4’ for 2nd argument  
FLWCVector4 LWCSubtract(float4 Lhs, FLWCVector4 Rhs) { return MakeLWCVector4(- (( Rhs ).Tile), Lhs - Rhs.Offset); }  
^  
/Engine/Private/LWCOperations.ush:58:13: note: candidate function not viable: no known conversion from ‘float’ to ‘FLWCVector4’ for 1st argument  
FLWCVector4 LWCSubtract(FLWCVector4 Lhs, float4 Rhs) { return MakeLWCVector4( (( Lhs ).Tile), Lhs.Offset - Rhs); }  
^  
/Engine/Private/LWCOperations.ush:56:12: note: candidate function not viable: no known conversion from ‘float’ to ‘FLWCScalar’ for 1st argument  
FLWCScalar LWCSubtract(FLWCScalar Lhs, FLWCScalar Rhs) { return MakeLWCScalar( (( Lhs ).Tile) - (( Rhs ).Tile), Lhs.Offset - Rhs.Offset); }  
^  
/Engine/Private/LWCOperations.ush:56:13: note: candidate function not viable: no known conversion from ‘float’ to ‘FLWCVector2’ for 1st argument  
FLWCVector2 LWCSubtract(FLWCVector2 Lhs, FLWCVector2 Rhs) { return MakeLWCVector2( (( Lhs ).Tile) - (( Rhs ).Tile), Lhs.Offset - Rhs.Offset); }  
^  
/Engine/Private/LWCOperations.ush:56:13: note: candidate function not viable: no known conversion from ‘float’ to ‘FLWCVector3’ for 1st argument  
FLWCVector3 LWCSubtract(FLWCVector3 Lhs, FLWCVector3 Rhs) { return MakeLWCVector3( (( Lhs ).Tile) - (( Rhs ).Tile), Lhs.Offset - Rhs.Offset); }  
^  
/Engine/Private/LWCOperations.ush:56:13: note: candidate function not viable: no known conversion from ‘float’ to ‘FLWCVector4’ for 1st argument  
FLWCVector4 LWCSubtract(FLWCVector4 Lhs, FLWCVector4 Rhs) { return MakeLWCVector4( (( Lhs ).Tile) - (( Rhs ).Tile), Lhs.Offset - Rhs.Offset); }  
^  
/Engine/Generated/Material.ush:3972:23: error: no matching function for call to ‘LWCSubtract’  
FLWCScalar Local17 = LWCSubtract(Local12, 1700.00000000);

* * *

**Second error:**  
_LogOutputDevice: Error: === Handled ensure: ===_  
\*LogOutputDevice: Error: Ensure condition failed: false [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp] [Line: 8558] \*  
_LogOutputDevice: Error: FHLSLMaterialTranslator::IsExpressionConstantValue - Unknown constant expression type_  
\*LogOutputDevice: Error: Stack: \*  
_LogOutputDevice: Error: [Callstack] 0x00007ff91a226282 UnrealEditor-Engine.dll!UnknownFunction []_  
_LogOutputDevice: Error: [Callstack] 0x00007ff91a1e056d UnrealEditor-Engine.dll!UnknownFunction []_  
_LogOutputDevice: Error: [Callstack] 0x00007ff91a1d1435 UnrealEditor-Engine.dll!UnknownFunction []_

**Custom logic in generated material from CesiumFeaturesMetadata component:**

 ![image](https://global.discourse-cdn.com/cesium/original/3X/5/4/54a4dad3dad1fc329fa8fd0406f18c0a80bcc03f.png)

Is the problem in my implementation or in the CesiumBaseMaterial?  
Thank you very much for any suggestions and solutions. 🙂

---

<div class="post-metadata">

**Author:** ![azrogers](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/azrogers/32/21672_2.png) [@azrogers](https://community.cesium.com/u/azrogers)\
**Post date:** [October 25, 2024, 8:28pm UTC](https://community.cesium.com/t/visualize-mesh-features-and-metadata/36031/2 "2024-10-25T20:28:50Z")

</div>

It looks like you’re seeing a lot of errors related to Unreal’s Large World Coordinates changes in Unreal 5. What version of Unreal are you using?

---

<div class="post-metadata">

**Author:** ![NicolasNguyen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/nicolasnguyen/32/14037_2.png) [@NicolasNguyen](https://community.cesium.com/u/NicolasNguyen)\
**Post date:** [October 27, 2024, 2:47pm UTC](https://community.cesium.com/t/visualize-mesh-features-and-metadata/36031/3 "2024-10-27T14:47:57Z")

</div>

I tried it on versions 5.4.1 and 5.4.4.

---

<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:** [October 29, 2024, 6:07am UTC](https://community.cesium.com/t/visualize-mesh-features-and-metadata/36031/4 "2024-10-29T06:07:41Z")

</div>

Hi @NicolasNguyen,  
I’m not sure where those errors might be coming from. First thing to check: does the Metadata level in the Cesium for Unreal Samples project for you?

---

<div class="post-metadata">

**Author:** ![NicolasNguyen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/nicolasnguyen/32/14037_2.png) [@NicolasNguyen](https://community.cesium.com/u/NicolasNguyen)\
**Post date:** [October 29, 2024, 5:13pm UTC](https://community.cesium.com/t/visualize-mesh-features-and-metadata/36031/5 "2024-10-29T17:13:55Z")

</div>

Hello @Kevin_Ring,  
Yes, both _06\_CesiumMetadata_ and _10\_CesiumOSMWindows\_Metadata_ are working fine.  
The error only occurs, when I am trying to make my own material for the _CesiumEncodedMetadata component_ following the tutorial mentioned above.

Thank you

---

<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:** [November 4, 2024, 6:34am UTC](https://community.cesium.com/t/visualize-mesh-features-and-metadata/36031/6 "2024-11-04T06:34:04Z")

</div>

Good to hear the Samples work, at least. I haven’t run through the tutorial myself in a little while, but I’m not aware of any problems with it. Since the Samples do work for you, perhaps it would be beneficial to compare the materials included with them against the ones you developed during the tutorial, and see if you can spot the difference?

---

<div class="post-metadata">

**Author:** ![NicolasNguyen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/nicolasnguyen/32/14037_2.png) [@NicolasNguyen](https://community.cesium.com/u/NicolasNguyen)\
**Post date:** [November 16, 2024, 8:36pm UTC](https://community.cesium.com/t/visualize-mesh-features-and-metadata/36031/7 "2024-11-16T20:36:09Z")

</div>

I tried to find some differences and potential problems. I found that the cause of the problem is somewhere before the _MakeFloat3_ , when I add a constant instead of _Results_ of _RemapValueRangeNormalized_ the errors are gone. Also when I was comparing the _10\_CesiumOSMWindows\_Metadata_ from cesium project _CesiumForUnrealSamples_ I noticed that in that example is used different component: _CesiumEncodedMetadata_ but in the tutorial is used _CesiumFeaturesMetadata_ . The descriptions of these components are the same, but the funkcionality is different. There is no mention about this, why? I use same version for CesiumForUnrealSamples and the tutorial. So used components should be the same. Thank you.

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [November 18, 2024, 4:32pm UTC](https://community.cesium.com/t/visualize-mesh-features-and-metadata/36031/8 "2024-11-18T16:32:36Z")

</div>

Hi @NicolasNguyen,

Thanks for the note. I’m not sure why the RemapValueRangeNormalized node resulted in issues. 🤔

The `CesiumEncodedMetadata` component is actually outdated, and was meant to be replaced by `CesiumFeaturesMetadata`. Alas, we forgot to update that level you mentioned, so it is still using the deprecated API. I’ve made an issue here for the samples project so we can get an eventual fix:

> <https://github.com/CesiumGS/cesium-unreal-samples/issues/60>
>
> As noted on the community forum here: https://community.cesium.com/t/visualize-m…esh-features-and-metadata/36031/6
> 
> This level still uses the outdated \`CesiumEncodedMetadata\` component -- we should replace it to use \`CesiumFeaturesMetadata\` instead.

Thanks for bringing this to our attention!
