Disable terrain elevations

I’m using STK world terrain provider on my cesium project, but I need it just for the light / shading effect. I don’t want any terrain elevation / heights. On first sight the whole globe was flat / even , but I noticed at one place, the terrain is jagged. I tried setting hasVertexNormals and requestVertexNormals to false but nothing changes. Is there a way to disable terrain elevations / heights, while still using the terrain provider? Thanks.

p.s. I guess you know what I’m talking about but here are two screenshots, the first - jagged terrain , and the second - flat terrain

I’m a little confused. Why would you want to use the terrain provider but disable the elevations?

Having some insight would help me answer your question.



Hi Hannah and thank you for your response,
The only purpose I’m using terrain provider for, is to place a light source from viewer’s position, so that my planet looks more 3d, like a globe and not like a circle. It’s just for the visual effect of light and shadow when the planet is zoomed out. I’m using the sun as the light source, however, as the sun is moving when the planet is rotated, I have applied a hack suggested by Sean Lilley, as follows:

I’m not sure about an official way to do this, but if you are ok with a hacky solution and don’t mind editing the source code, this should work:

After this line: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Renderer/UniformState.js#L846 put the code:

Cartesian3.clone(frameState.camera.directionWC, uniformState._sunDirectionWC);

Cartesian3.clone(Cartesian3.UNIT_Z, uniformState._sunDirectionEC);
[End Quote]

I thought that I may use the EllipsoidTerrainProvider, and indeed all the terrain is flat with it, however, when applied with this hack, there isn’t any light / shadow, and the planet is still just a 2d circle. Otherwise, I don’t need any terrain elevations.

*I mean, the light / shadow is moving, not the sun *