Slope fails for quantized tiles

The slope and the aspect shaders don’t work correctly then the tiles zoom is bigger than 12.

Checking the values in the shader it seems that the materialInput.slope value is always the max value (π/2)

A further investigation going through the code shows that the slope value is fixed to π/2 when the TerrainEncoding set the quantization is set to TerrainQuantization.BITS12

To be sure that the error wasn’t caused by the terrain tiles I’ve moved the check value that move the quantization value from NONE to BITS12

var SHIFT_LEFT_12 = Math.pow(2.0, 12.0);

to something like

var SHIFT_LEFT_12 = Math.pow(2.0, 4.0);

This change make everything works correctly.

Then the issue is in the management of the quantized tiles. Maybe this is written somewhere in the documentation and it works as expected but I haven’t found any reference about it.

The issue is in the 1.60 version with every browser I’ve tested.

Any thoughs?

Thanks

Davide Fiorello

This sounds like it might be a bug in CesiumJS. Do you happen to have a Sandcastle example that recreates it? It would also be great to open a pull request to fix this (and the Sandcastle will help the reviewer verify the issue and the proposed fix)