Fix #114096: Workbench: Broken thumbnail shadows
This is the same as 5d06632565fe9cc6ea54260e746c437eaaa23888 but ported to the no-geometry shader version. However the rendering is still broken for another reason. See #114286.
This commit is contained in:
parent
2e1244f3cf
commit
b26f176d1a
@ -39,6 +39,8 @@ vec3 extrude_offset(vec3 ls_P)
|
||||
if (L_dot_FP > 0.0) {
|
||||
float signed_distance = dot(pass_data.far_plane.xyz, ws_P) - pass_data.far_plane.w;
|
||||
extrude_distance = -signed_distance / L_dot_FP;
|
||||
/* Ensure we don't overlap the far plane. */
|
||||
extrude_distance -= 1e-3f;
|
||||
}
|
||||
return pass_data.light_direction_ws * extrude_distance;
|
||||
}
|
||||
|
@ -70,6 +70,8 @@ vec3 extrude_offset(vec3 ls_P)
|
||||
if (L_dot_FP > 0.0) {
|
||||
float signed_distance = dot(pass_data.far_plane.xyz, ws_P) - pass_data.far_plane.w;
|
||||
extrude_distance = -signed_distance / L_dot_FP;
|
||||
/* Ensure we don't overlap the far plane. */
|
||||
extrude_distance -= 1e-3f;
|
||||
}
|
||||
return pass_data.light_direction_ws * extrude_distance;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user