feat: add forward+ rendering
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#ifndef LIGHTS_GLSL
|
||||
#define LIGHTS_GLSL
|
||||
|
||||
#extension GL_EXT_buffer_reference : require
|
||||
|
||||
#define TYPE_DIRECTIONAL_LIGHT 0
|
||||
#define TYPE_POINT_LIGHT 1
|
||||
#define TYPE_SPOT_LIGHT 2
|
||||
|
||||
// Forward+ tiling, must match LightCullingPipeline::TILE_SIZE / MAX_LIGHTS_PER_TILE
|
||||
#define LIGHT_TILE_SIZE 16
|
||||
#define MAX_LIGHTS_PER_TILE 255
|
||||
// Every tile stores its light count first, followed by MAX_LIGHTS_PER_TILE light indices
|
||||
#define LIGHT_TILE_STRIDE (MAX_LIGHTS_PER_TILE + 1)
|
||||
|
||||
// Must match GPULight in Light.h
|
||||
struct Light {
|
||||
vec3 position;
|
||||
float range;
|
||||
|
||||
vec3 color;
|
||||
float intensity;
|
||||
|
||||
// direction the light is pointing in (directional + spot lights)
|
||||
vec3 direction;
|
||||
uint type;
|
||||
|
||||
float spotInnerCos;
|
||||
float spotOuterCos;
|
||||
vec2 padding;
|
||||
};
|
||||
|
||||
layout (buffer_reference, std430) readonly buffer LightsBuffer {
|
||||
Light data[];
|
||||
};
|
||||
|
||||
layout (buffer_reference, std430) buffer TileLightIndicesBuffer {
|
||||
uint data[];
|
||||
};
|
||||
|
||||
#endif // LIGHTS_GLSL
|
||||
Reference in New Issue
Block a user