feat: add spot light shadows with a tilled buffer
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
#define TYPE_POINT_LIGHT 1
|
||||
#define TYPE_SPOT_LIGHT 2
|
||||
|
||||
#define NO_SHADOW 0xFFFFFFFFu
|
||||
// Must match ShadowMapPipeline::MAX_SPOT_SHADOWS
|
||||
#define MAX_SPOT_SHADOWS 16
|
||||
|
||||
// Forward+ tiling, must match LightCullingPipeline::TILE_SIZE / MAX_LIGHTS_PER_TILE
|
||||
#define LIGHT_TILE_SIZE 16
|
||||
#define MAX_LIGHTS_PER_TILE 255
|
||||
@@ -27,10 +31,17 @@ struct Light {
|
||||
|
||||
float spotInnerCos;
|
||||
float spotOuterCos;
|
||||
uint castShadows;
|
||||
// NO_SHADOW, or the light's slot in the shadow data of its type
|
||||
uint shadowIndex;
|
||||
float padding;
|
||||
};
|
||||
|
||||
// Must match GPUSpotShadow in Light.h
|
||||
struct SpotShadow {
|
||||
mat4 lightViewProj;
|
||||
float normalOffsetPerMeter;
|
||||
};
|
||||
|
||||
layout (buffer_reference, std430) readonly buffer LightsBuffer {
|
||||
Light data[];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user