WMS Quality rendering

Hello all,

I am displaying pretty simple WMS images on my cesium globe, but they seem quite badly rendered. I have tried this with an entirely fresh refresh etc so the browser memory is as empty as possible, but no difference.

Attached is an image showing what I mean.

What I think it affecting it is that the image is being draped over the ground - although I guess this is what I want, does this affect the way it is rendered?

Any advice would be much appreciated.



Hi Toby,

Because you’re looking at a fairly northern latitude there, and you’re using WMS, which Cesium obtains using a geographic projection, you’re probably being bitten by the ‘latitudeFactor’. The latitudeFactor attempts to adjust imagery quality at higher latitudes based on the idea that pixels get smaller at higher latitudes. But in the geographic projection, they only get smaller along one dimension, so the image quality can suffer.

To test this theory and attempt a fix, try changing the ‘getLevelWithMaximumLevelSpacing’ function at the bottom of ImageryLayer.js to look like this (new lines in bold):

var tilingScheme = imageryProvider.getTilingScheme();

var ellipsoid = tilingScheme.getEllipsoid();

var latitudeFactor = Math.cos(latitudeClosestToEquator);

if (tilingScheme instanceof GeographicTilingScheme) {

latitudeFactor = 1.0;


var tilingSchemeExtent = tilingScheme.getExtent();

Let me know if it helps.

Hi Kevin,

That’s made it a fair bit better. Thank you.

Just to check though - using Cesium19, I am using the unminified version (issue with how the proxy is defaulted to have a ‘?’ in it), and the function I have edited is the “getLevelWithMaximumTexelSpacing” rather than the …LevelSpacing, as you suggested. I presume this is the one you mean (I don’t have the other one).

Resulting improvement attached. A little better when viewing far away, but much better coming in close.



Yes, that’s the right function. Sorry for the typo.