Skip to content

Commit

Permalink
Improve Split Blending for OpenGL
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjustaguy committed Oct 13, 2023
1 parent ee118e7 commit c1c2559
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gles3/shaders/scene.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ void main() {

#ifdef LIGHT_USE_PSSM_BLEND
directional_shadow2 = shadow2;
pssm_blend = smoothstep(0.0, light_split_offsets.x, depth_z);
pssm_blend = smoothstep(light_split_offsets.x - light_split_offsets.x * 0.1, light_split_offsets.x, depth_z);
#endif
} else {
directional_shadow = shadow2;
Expand Down Expand Up @@ -1672,15 +1672,15 @@ void main() {
#ifdef LIGHT_USE_PSSM_BLEND
directional_shadow2 = shadow2;

pssm_blend = smoothstep(0.0, light_split_offsets.x, depth_z);
pssm_blend = smoothstep(light_split_offsets.x - light_split_offsets.x * 0.1, light_split_offsets.x, depth_z);
#endif
} else {
directional_shadow = shadow2;

#ifdef LIGHT_USE_PSSM_BLEND
directional_shadow2 = shadow3;

pssm_blend = smoothstep(light_split_offsets.x, light_split_offsets.y, depth_z);
pssm_blend = smoothstep(light_split_offsets.y - light_split_offsets.y * 0.1, light_split_offsets.y, depth_z);
#endif
}
} else {
Expand All @@ -1689,7 +1689,7 @@ void main() {

#if defined(LIGHT_USE_PSSM_BLEND)
directional_shadow2 = shadow4;
pssm_blend = smoothstep(light_split_offsets.y, light_split_offsets.z, depth_z);
pssm_blend = smoothstep(light_split_offsets.z - light_split_offsets.z * 0.1, light_split_offsets.z, depth_z);
#endif

} else {
Expand Down

0 comments on commit c1c2559

Please sign in to comment.