mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-23 17:30:42 +00:00
a626dc7ca8
This takes care of the type punning issue by each pass using the correct sampler type with the correct view types bound. Also, point light and spot light shadow maps are now guaranteed to be separated (it was just luck that they were before) and spot light maps may be significantly smaller as their cone angle is taken into account. Lighting is quite borked, but at least the engine is running again.
29 lines
803 B
C
29 lines
803 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 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[];
|
|
};
|