-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Skip face culling in shadows for double-sided materials (e.g. plantlike) #13500
Conversation
Seems to work. :) |
Actually... This seems to also remove shadows from water. |
@x2048 any updates on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not notice any difference with plantlike and rooted plantlike.
Two screenshots of the problem described by lhofhansl: Screenshots taken in Minetest Game, but with the dynamic shadow intensity variation stuff removed. Instead: player:set_lighting({ shadows = { intensity = 0.85 } })
|
Cannot reproduce the water shadow issue. I am using the following dynamic shadows settings:
EDIT: also using |
@grorp or @lhofhansl if you have a moment please re-test |
The problem I was seeing is gone now. Shadows on water are correct now. |
The problem I was seeing is fixed as well (it was the same problem). |
@x2048 Wanna merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this PR and it fixes the issue. Plant-like nodes cast correct shadows. Shadows on water (liquid) surface and inside water look brighter than master
branch.
Test | master branch |
This PR |
---|---|---|
Plant-like shadows | ||
Shadows on water (liquid) surface and inside water |
Contents of minetest.conf
:
enable_shaders = true
antialiasing = ssaa
shadow_filters = 1
shadow_levels = 5
shadow_map_color = false
shadow_map_max_distance = 140
shadow_map_texture_32bit = true
shadow_map_texture_size = 2048
enable_dynamic_shadows = true
On your second screenshot, all shadows look brighter, whether in the water or outside. Could the brightness difference possibly be caused by MTG's shadow intensity randomization (minetest/minetest_game#3024)? Just tried again, this PR doesn't change anything related to water shadows for me:
All the screenshots look nearly identical to me. |
@srifqi Would you be fine with merging this? |
Yes.
I guess. The problem disappears in other games. |
@x2048 Still around? |
@lhofhansl still around, not active. |
…ke) (minetest#13500) * Skip face culling in shadows for double-sided materials (e.g. plantlike) * Keep previous face culling for transparent surfaces e.g. water
…ke) (minetest#13500) * Skip face culling in shadows for double-sided materials (e.g. plantlike) * Keep previous face culling for transparent surfaces e.g. water
At some sun angles, plantlike nodes produce incomplete or no shadow. This is because they render double-sided (no face culling) but shadow renderer does not respect that and culls front faces.
This PR fixes this problem by only overriding culling for nodes where at least one side is culled in the original material.
To do
This PR is Ready for Review.
How to test