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

Fix OpenGL directional shadow last split fading #83252

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions drivers/gles3/shaders/scene.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -1615,15 +1615,13 @@ void main() {
float directional_shadow = 1.0;

if (depth_z < light_split_offsets.y) {
mrjustaguy marked this conversation as resolved.
Show resolved Hide resolved
float pssm_fade = 0.0;

#ifdef LIGHT_USE_PSSM_BLEND
float directional_shadow2 = 1.0;
float pssm_blend = 0.0;
bool use_blend = true;
#endif
if (depth_z < light_split_offsets.x) {
float pssm_fade = 0.0;
directional_shadow = shadow1;

#ifdef LIGHT_USE_PSSM_BLEND
Expand All @@ -1632,7 +1630,6 @@ void main() {
#endif
} else {
directional_shadow = shadow2;
pssm_fade = smoothstep(light_split_offsets.x, light_split_offsets.y, depth_z);
#ifdef LIGHT_USE_PSSM_BLEND
use_blend = false;
#endif
Expand All @@ -1642,7 +1639,6 @@ void main() {
directional_shadow = mix(directional_shadow, directional_shadow2, pssm_blend);
}
#endif
directional_shadow = mix(directional_shadow, 1.0, pssm_fade);
}

#endif //LIGHT_USE_PSSM2
Expand All @@ -1658,7 +1654,6 @@ void main() {
float directional_shadow = 1.0;

if (depth_z < light_split_offsets.w) {
mrjustaguy marked this conversation as resolved.
Show resolved Hide resolved
float pssm_fade = 0.0;

#ifdef LIGHT_USE_PSSM_BLEND
float directional_shadow2 = 1.0;
Expand Down Expand Up @@ -1694,7 +1689,6 @@ void main() {

} else {
directional_shadow = shadow4;
pssm_fade = smoothstep(light_split_offsets.z, light_split_offsets.w, depth_z);

#if defined(LIGHT_USE_PSSM_BLEND)
use_blend = false;
Expand All @@ -1706,7 +1700,6 @@ void main() {
directional_shadow = mix(directional_shadow, directional_shadow2, pssm_blend);
}
#endif
directional_shadow = mix(directional_shadow, 1.0, pssm_fade);
}

#endif //LIGHT_USE_PSSM4
Expand Down
Loading