-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Enhance tile skirts light occlusion #11460
base: main
Are you sure you want to change the base?
Conversation
Thanks for the pull request @calogeromauceri!
Reviewers, don't forget to make sure that:
|
Thanks for the suggestion @calogeromauceri! @lilleyse Would you mind taking a look at the overall approach here? |
I wonder if this can also be solved by disabling back face culling for terrain shadow map commands, i.e. set this line to false. |
thanks @lilleyse for looking into this. I tried the solution you suggested, but it seems to me disabling it does not work well in some circumstances. and here is another view where the skirts artifacts are still visible Using the longer skirts approach I suggested, seems to produce better shadows Maybe an hybrid approach using long skirts and disabling back face culling for terrain shadow map commands would produce even better results? I'm not an expert just testing some trivial changes, you might have a better insight knowledge |
Thanks again for your contribution @calogeromauceri! No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with |
@lilleyse Do you have any other suggestions on the approach here? Or is this the most straightforward given the backface culling idea doesn't seem to be working in all cases? |
Is it possible to enable long skirts and bottom plane only if terrain shadow casting is enabled? That way this change doesn't affect performance in the general case. |
@lilleyse I've had the chance to delve into the implementation of the changes you suggested regarding enabling long skirts and a bottom plane exclusively when terrain shadow casting is enabled. However, since the tile mesh, including skirt vertices, is generated at load time, dynamically adjusting them based on shadow casting isn't feasible. As an alternative, we could add a flag to the terrain provider upon creation that enables these features. Do you think this solution fits our needs or do you think there are better alternatives? |
That would be ok, I think. |
… skirts for better light occlusion when shaddows are enabled
@lilleyse @ggetz I added a flag called Here is a simple sandcastle example on how to use it |
I'm proposing the following solution for this issue #11459
The tile skirst are causing artifacts on shadows when the light is tanget to the tile, i.e. when it is near the horizon.
The tangent light should be occluded, but it leaks from below the terrain tile. The skirt is casting a thin shadow that is causing artifacts on the final result.
The solution I'm proposing is to increase the skirt size an to add a plane to the bottom of the tile, in that way the light cannot pass through the side/bottom of it and the terrain is better shadowed.
Here is a sandcastle example with the default behavior (advance the time till the artifacts are visible)
sandcastle
and this is the result with the proposed solution
Here is an example of the tile with the longer skirts
Let me know if the proposed fix makes sense or if there is any better solution