Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to enable terrain to also cast shadows? #3

Open
rumicuna opened this issue Jan 10, 2024 · 10 comments
Open

How to enable terrain to also cast shadows? #3

rumicuna opened this issue Jan 10, 2024 · 10 comments

Comments

@rumicuna
Copy link

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.

@rumicuna
Copy link
Author

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
Copy link
Author

Here's my modified sandcastle example, with added terrain and exclude_terrain = false;

@rumicuna
Copy link
Author

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:

image

@stj29
Copy link

stj29 commented Mar 19, 2024

@rumicuna How to solve the surface flicker when the perspective rotates ?

@xsherlockpl
Copy link

@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
Copy link
Author

rumicuna commented 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
Copy link

xsherlockpl commented May 3, 2024

Ok, So in my case I can see building casting shadow on terrain, but the implementation is wrong.
image

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

image

@syzdev
Copy link

syzdev commented Jun 24, 2024

@xsherlockpl

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.

@StevenPG
Copy link

StevenPG commented Oct 8, 2024

Does this mean this SensorShadow library just doesn't support terrain?

@TJKoury
Copy link
Contributor

TJKoury commented Oct 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants