mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-19 07:51:08 +00:00
[vulkan] Simplify cubemap frame conversion
Don't need a whole matrix multiply when a swizzle and single vector multiply will do.
This commit is contained in:
parent
71934b15f4
commit
e4ed868023
1 changed files with 2 additions and 3 deletions
|
@ -21,9 +21,8 @@ shadow (uint map_id, uint layer, uint mat_id, vec3 pos, vec3 lpos)
|
|||
vec4 p = shadow_mats[mat_id + ind] * vec4 (pos, 1);
|
||||
p = p / (p.w - 0.5); //FIXME hard-coded bias
|
||||
float depth = p.z;
|
||||
dir = mat3(vec3( 0, 0, 1),
|
||||
vec3(-1, 0, 0),
|
||||
vec3( 0, 1, 0)) * dir;
|
||||
// convert from the quake frame to the cubemap frame
|
||||
dir = dir.yzx * vec3 (-1, 1, 1);
|
||||
return texture (shadow_map[map_id], vec4 (dir, layer), depth);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue