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

Restore and fix post-process shadow blurring in 3D #58771

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ void fragment_shader(in SceneData scene_data) {
}
#endif

blur_shadow(shadow);
shadow = blur_shadow(shadow);

float size_A = sc_use_light_soft_shadows ? directional_lights.data[i].size : 0.0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -951,21 +951,16 @@ void reflection_process(uint ref_index, vec3 view, vec3 vertex, vec3 normal, flo
}

float blur_shadow(float shadow) {
return shadow;
#if 0
//disabling for now, will investigate later
float interp_shadow = shadow;
if (gl_HelperInvocation) {
interp_shadow = -4.0; // technically anything below -4 will do but just to make sure
}

uvec2 fc2 = uvec2(gl_FragCoord.xy);
interp_shadow -= dFdx(interp_shadow) * (float(fc2.x & 1) - 0.5);
interp_shadow -= dFdy(interp_shadow) * (float(fc2.y & 1) - 0.5);
interp_shadow -= dFdxFine(interp_shadow) * (float(fc2.x & 1) - 0.5);
interp_shadow -= dFdyFine(interp_shadow) * (float(fc2.y & 1) - 0.5);
interp_shadow = min(interp_shadow, 1.0);

if (interp_shadow >= 0.0) {
shadow = interp_shadow;
}

return shadow;
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ void main() {
shadow = float(shadow1 >> ((i - 4) * 8) & 0xFF) / 255.0;
}
#endif
blur_shadow(shadow);
shadow = blur_shadow(shadow);

light_compute(normal, directional_lights.data[i].direction, normalize(view), 0.0, directional_lights.data[i].color * directional_lights.data[i].energy, shadow, f0, orms, 1.0, albedo, alpha,
#ifdef LIGHT_BACKLIGHT_USED
Expand Down