I’m using Cesium for Unreal to sample terrain heights at runtime for a set of points (used for vegetation placement). However, I’m encountering frequent sampling failures. Many of the points return SampleSuccess as false. These failures happen consistently for certain coordinates. I am using SampleHeightMostDetialed function to sample the heights. What are the typical reasons for height sampling to fail at runtime in Cesium for Unreal? How can I improve the reliability of sampling large batches of points?
make sure tiles are correctly loaded for points for which you want to sample the height.
to simply check this execute the the process and when you get the result back go to properties of the cesium3dtileset actor and freez the updates. zoomout a little bit and you will see if tiles where you want to sample the height is loaded or not.
We cannot sample height for the points when the Tileset is freeze(suspend update is true). I tried zooming out, the tiles were loaded in that area but sampling in failing consistently on some specific points.
SampleHeightMostDetailed fails if it isn’t able to intersect the dataset at the specified longitude / latitude coordinates. I’m not sure why it wouldn’t work otherwise, but it would help to know more details, such as:
What versions of Unreal Engine and Cesium for Unreal are you using?
What dataset are you trying to sample heights from?
Are you using Blueprints or C++ to call the function? Can you share your code?
And for future reference, SampleHeightMostDetailed is an asynchronous function, so it requires the tileset to continuously update so it can traverse and query tiles. That’s why it freezes when SuspendUpdate is enabled.