mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-23 09:20:40 +00:00
452459297d
It didn't really work all that well and isn't necessary with the front-face culling. One less op per pixel.
19 lines
501 B
GLSL
19 lines
501 B
GLSL
#version 450
|
|
#extension GL_GOOGLE_include_directive : enable
|
|
|
|
layout (set = 0, binding = 0) buffer ShadowMatrices {
|
|
mat4 shadow_mats[];
|
|
};
|
|
layout (set = 3, binding = 0) uniform sampler2DArrayShadow shadow_map[32];
|
|
|
|
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;
|
|
float depth = p.z;
|
|
vec2 uv = (p.xy + vec2(1)) / 2;
|
|
return texture (shadow_map[map_id], vec4 (uv, layer, depth));
|
|
}
|
|
|
|
#include "lighting_main.finc"
|