Hey @Rxmex,
Good to see you again! This is a great follow-on question from your aviation GPS build.
The drift you’re seeing is because Absolute World Position Z in a UE material is the Unreal Engine world Z coordinate, which is anchored to wherever your CesiumGeoreference origin is placed. That works fine near the origin, but as you move away from it two things happen:
- The earth curves. The UE world was set up with the georeference origin as its tangent point on the globe. Far from that point, the earth’s surface tilts relative to UE’s Z axis, so “material Z” no longer equals “altitude above the ellipsoid.”
- Coordinate values get large. Positions far from the origin involve large floating-point numbers and the material math loses precision.
A simple option: Keep the georeference origin near the camera at all times. Cesium for Unreal has CesiumOriginShiftComponent for exactly this. Add it to your player pawn and it automatically repositions the georeference as you move. With that in place, your altitude-based material values stay accurate anywhere on the globe.
Another option: For the material side, I recently covered this in another thread, the Cesium for Unreal Samples project (also on Fab) has a height-blend material example in Level 9 (09_CesiumMaterialEditing) that does exactly the kind of elevation-band coloring you’re after. That would be a solid starting point to adapt for your altitude zones.
Let me know if that gets things working!
Cheers!
