Accuracy of custom Materials in Cesium

1. A concise explanation of the problem you’re experiencing.

I am working on an application to display weather data on Cesium. In this application, the weather data is shown as a heat map with a slider that allows the user to select the range of data that they would like to display.

To create the heatmap, I drape a rectangle over the globe and use a Cesium material to create custom shader code to highlight the selected range of data. I encode the weather data as PNGs and pass them as a uniform.

The problem is that there is a slight offset with coordinates shown on Cesium and the actual data (e.g, the heat map should be shifted up to be correct and a certain coordinate). The offset is also in different directions in different parts of the globe. It’s small, usually less than half a degree. But it become a problem when zoomed in. Also, there isn’t a clear pattern to the offset (like the offset increasing when you go from north to south).

I know that I lose precision when I encode the data into the RGB channels of an image. But I ruled this out as the culprit because the offset is always in the same direction at the same location on the globe, regardless of what data is being displayed.

Is there any information about what might be causing this?

Thanks.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I can’t use a terrain for this application. Would creating the heat map as a custom primitive instead of a material fix this?

I am asking this because primitives are used for everything so people would have noticed if the coordinates were not precise. Whereas materials aren’t used as much so it is conceivable that no one would have have noticed if they aren’t perfectly precise.

4. The Cesium version you’re using, your operating system and browser.

Chrome, windows 10, cesium 1.50