Eevee: Fix contact shadow creating to overshadowing
This was because the shadow rays could be generated below the geometric normal.
This commit is contained in:
@@ -226,6 +226,10 @@ float light_visibility(LightData ld, vec3 W,
|
||||
|
||||
vec3 ray_ori = viewPosition;
|
||||
|
||||
if (dot(viewNormal, ray_dir) <= 0.0) {
|
||||
return vis;
|
||||
}
|
||||
|
||||
float bias = 0.5; /* Constant Bias */
|
||||
bias += 1.0 - abs(dot(viewNormal, ray_dir)); /* Angle dependent bias */
|
||||
bias *= gl_FrontFacing ? data.sh_contact_offset : -data.sh_contact_offset;
|
||||
|
||||
Reference in New Issue
Block a user