Use shadow blurring in deferred rendering
This commit is contained in:
parent
bd5622fc3b
commit
b0b2975efc
1 changed files with 11 additions and 1 deletions
|
|
@ -455,7 +455,17 @@ void main()
|
|||
// color = vec3(float(l & 1), float(l & 2) / 2.0, float(l & 4) / 4.0);
|
||||
// break;
|
||||
|
||||
color *= texture(u_shadow, vec4(tc.x, tc.y, float(cascade), tc.z));
|
||||
float s = 0.0;
|
||||
for (int tx = -2; tx <= 2; ++tx)
|
||||
{
|
||||
for (int ty = -2; ty <= 2; ++ty)
|
||||
{
|
||||
float d = 1.0 / 1024.0 / pow(2.0, float(cascade));
|
||||
s += texture(u_shadow, vec4(tc.x + float(tx) * d, tc.y + float(ty) * d, float(cascade), tc.z)) / 25.0;
|
||||
}
|
||||
}
|
||||
|
||||
color *= s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue