You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for releasing this, you guys are the best!!
Question: is there a way to have the visibility also work with the terrain so it casts a shadow on itself?
The buildings cast shadows on themselfs and on the terrain beautifully, but the terrain does not.
I the Cesium Sandcastle demo: https://sandcastle.cesium.com/?src=Shadows.html
The terrain can cast shadows on itself, and there is a variable on your code = exclude_terrain which seemed promising so I set it to false, but this had no effect.
If you run my modified sandcastle version above, what I see is below, while I'm hoping to be able to have the terrain hast a shadow on itself as indicated in the image:
@rumicuna your sandcastle example does not load properly. @stj29 unfortunately I also see clipping on all surfaces as the emmiter dot being moved or viewport changed.
@xsherlockpl@TJKouryhere's the updated Sandcastle demo with terrain. All that is diffrent from the repo's Sandcastle demo is that I've turned on terrain.
The code seems to have be updated recently, but I can't get the terrain to cast shadows. The buildings cast shadows on themselves and on the terrain beautifully, but the terrain itself does not cast shadows on itself or on the buildings.
Ok, So in my case I can see building casting shadow on terrain, but the implementation is wrong.
The road behind the building is a canyon in terrain, there should be shadow there both from the building and terrain and somehow it is lit green. So there is something seriously wrong with the cesium viewshed. I'd love to see the version from their super expensive SDK.
BTW Has anyone figured out what does the depthBias prarameter does?
It seems it is infulencing a zoom level/distance at which i see the glitching
BTW Has anyone figured out what does the depthBias prarameter does?
Shadows are implemented based on depth, and when two depth values are too close, it is difficult to distinguish the occlusion relationship between objects. This can lead to Z-fighting problems. Adding offset values can cause slight deviations between the two depths, effectively alleviating the Z-fighting problem. However, the setting of this value is based on experience.
To fully support terrain you need to enable / use cascades, or else the shadows will not be sampled correctly. That goes for anything in the scenario, as well.
Activity
rumicuna commentedon Jan 10, 2024
I the Cesium Sandcastle demo:
https://sandcastle.cesium.com/?src=Shadows.html
The terrain can cast shadows on itself, and there is a variable on your code = exclude_terrain which seemed promising so I set it to false, but this had no effect.
rumicuna commentedon Jan 10, 2024
Here's my modified sandcastle example, with added terrain and exclude_terrain = false;
rumicuna commentedon Jan 10, 2024
If you run my modified sandcastle version above, what I see is below, while I'm hoping to be able to have the terrain hast a shadow on itself as indicated in the image:
stj29 commentedon Mar 19, 2024
@rumicuna How to solve the surface flicker when the perspective rotates ?
xsherlockpl commentedon May 2, 2024
@rumicuna your sandcastle example does not load properly.
@stj29 unfortunately I also see clipping on all surfaces as the emmiter dot being moved or viewport changed.
rumicuna commentedon May 2, 2024
@xsherlockpl @TJKoury here's the updated Sandcastle demo with terrain. All that is diffrent from the repo's Sandcastle demo is that I've turned on terrain.
The code seems to have be updated recently, but I can't get the terrain to cast shadows. The buildings cast shadows on themselves and on the terrain beautifully, but the terrain itself does not cast shadows on itself or on the buildings.
xsherlockpl commentedon May 3, 2024
Ok, So in my case I can see building casting shadow on terrain, but the implementation is wrong.

The road behind the building is a canyon in terrain, there should be shadow there both from the building and terrain and somehow it is lit green. So there is something seriously wrong with the cesium viewshed. I'd love to see the version from their super expensive SDK.
BTW Has anyone figured out what does the depthBias prarameter does?
It seems it is infulencing a zoom level/distance at which i see the glitching
syzdev commentedon Jun 24, 2024
@xsherlockpl
Shadows are implemented based on depth, and when two depth values are too close, it is difficult to distinguish the occlusion relationship between objects. This can lead to Z-fighting problems. Adding offset values can cause slight deviations between the two depths, effectively alleviating the Z-fighting problem. However, the setting of this value is based on experience.
StevenPG commentedon Oct 8, 2024
Does this mean this SensorShadow library just doesn't support terrain?
TJKoury commentedon Oct 8, 2024
afzaale01 commentedon Mar 27, 2025
Guys just enable the configuration of cesium viewer. It is working in the sandcastle. LINK
afzaale01 commentedon Mar 27, 2025
@TJKoury @rumicuna The PR is open please check it. Request
TJKoury commentedon Mar 28, 2025
To fully support terrain you need to enable / use cascades, or else the shadows will not be sampled correctly. That goes for anything in the scenario, as well.