[vulkan] Remove hard-coded shadow bias

It didn't really work all that well and isn't necessary with the
front-face culling. One less op per pixel.
This commit is contained in:
Bill Currie 2023-08-05 19:59:53 +09:00
parent 5a6d3ec3c9
commit 452459297d
2 changed files with 2 additions and 2 deletions

View file

@ -19,7 +19,7 @@ shadow (uint map_id, uint layer, uint mat_id, vec3 pos, vec3 lpos)
: dir.z <= -adir.z ? 3
: dir.z >= adir.z ? 2 : 0;
vec4 p = shadow_mats[mat_id + ind] * vec4 (pos, 1);
p = p / (p.w - 0.5); //FIXME hard-coded bias
p = p / p.w;
float depth = p.z;
// convert from the quake frame to the cubemap frame
dir = dir.yzx * vec3 (-1, 1, 1);

View file

@ -10,7 +10,7 @@ float
shadow (uint map_id, uint layer, uint mat_id, vec3 pos, vec3 lpos)
{
vec4 p = shadow_mats[mat_id] * vec4 (pos, 1);
p = p / (p.w - 0.5); //FIXME hard-coded bias
p = p / p.w;
float depth = p.z;
vec2 uv = (p.xy + vec2(1)) / 2;
return texture (shadow_map[map_id], vec4 (uv, layer, depth));