quakeforge/libs/video/renderer/vulkan/shader/lighting.h
Bill Currie 00040c8900 [vulkan] Hook up all the shadow resources
This gets everything but the actual shadow map bindings working: the
validation layers don't like my type punning (which may well be the
right thing) and specialization constants don't help (yet, anyway) but I
want to get things into git.
2023-08-01 23:34:08 +09:00

30 lines
828 B
C

struct LightData {
vec4 color; // .a is intensity
vec4 position; // .w = 0 -> directional, .w = 1 -> point/cone
vec4 direction; // .w = -cos(cone_angle/2) (1 for omni/dir)
vec4 attenuation;
};
#define ST_NONE 0 // no shadows
#define ST_PLANE 1 // single plane shadow map (small spotlight)
#define ST_CASCADE 2 // cascaded shadow maps
#define ST_CUBE 3 // cubemap (omni, large spotlight)
struct LightRender {
uint id_data;
uint style;
};
layout (set = 1, binding = 0) buffer LightIds {
uint lightCount;
uint lightIds[];
};
layout (set = 1, binding = 1) buffer Lights {
LightData lights[];
};
layout (set = 1, binding = 2) buffer Renderer {
LightRender renderer[];
};
layout (set = 1, binding = 3) buffer Style {
vec4 style[];
};