Forward+ Debugging commit, dont try it.
This commit is contained in:
@@ -14,29 +14,11 @@ struct Frustum {
|
||||
Plane Planes[4];
|
||||
};
|
||||
|
||||
layout (std430, binding = 1) buffer FrustumBuffer
|
||||
layout (std430, binding = 0) buffer FrustumBuffer
|
||||
{
|
||||
Frustum Data[80*45];
|
||||
Frustum Data[3600];
|
||||
} Frustums;
|
||||
|
||||
|
||||
struct PlaneNormals {
|
||||
vec3 Normal1;
|
||||
float pad1;
|
||||
vec3 Normal2;
|
||||
float Pad2;
|
||||
};
|
||||
|
||||
struct FrustumNormals {
|
||||
PlaneNormals Planes[4];
|
||||
};
|
||||
|
||||
layout (std430, binding = 2) buffer PlaneNormalBuffer
|
||||
{
|
||||
FrustumNormals Data[80*45];
|
||||
} FrustumNorm;
|
||||
|
||||
|
||||
vec4 ConvertToView(vec4 ScreenCoords)
|
||||
{
|
||||
vec2 normalizedScreenCoords = ScreenCoords.xy / ScreenDimensions;
|
||||
@@ -75,33 +57,6 @@ void main ()
|
||||
ViewVectors[i] = vec3(ConvertToView(ScreenCoords[i]));
|
||||
}
|
||||
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[0].Normal1 = (ViewVectors[2]);
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[0].Normal2 = (ViewVectors[0]);
|
||||
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[1].Normal1 = (ViewVectors[1]);
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[1].Normal2 = (ViewVectors[3]);
|
||||
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[2].Normal1 = (ViewVectors[0]);
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[2].Normal2 = (ViewVectors[1]);
|
||||
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[3].Normal1 = (ViewVectors[3]);
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[3].Normal2 = (ViewVectors[2]);
|
||||
/*
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[0].Normal1 = vec3(ScreenCoords[2]);
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[0].Normal2 = vec3(ScreenCoords[0]);
|
||||
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[1].Normal1 = vec3(ScreenCoords[1]);
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[1].Normal2 = vec3(ScreenCoords[3]);
|
||||
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[2].Normal1 = vec3(ScreenCoords[0]);
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[2].Normal2 = vec3(ScreenCoords[1]);
|
||||
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[3].Normal1 = vec3(ScreenCoords[3]);
|
||||
FrustumNorm.Data[gl_GlobalInvocationID.x + (80 * gl_GlobalInvocationID.y)].Planes[3].Normal2 = vec3(ScreenCoords[2]);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
vec3 EyePos = vec3(0,0,0);
|
||||
|
||||
Frustum f;
|
||||
|
||||
@@ -6,66 +6,30 @@
|
||||
//in uvec3 gl_GlobalInvocationID;
|
||||
//in uint gl_LocalInvocationIndex;
|
||||
|
||||
|
||||
|
||||
#define NUM_LIGHTS 3
|
||||
#define MAX_LIGHTS_PER_TILE 200
|
||||
#define NUM_TILES 3600
|
||||
|
||||
struct PointLight {
|
||||
vec4 Position;
|
||||
vec4 Color;
|
||||
float Radius;
|
||||
float Intensity;
|
||||
vec2 Pad;
|
||||
};
|
||||
|
||||
layout (std430, binding = 0) buffer PointLightBuffer
|
||||
{
|
||||
PointLight PointLights[NUM_LIGHTS];
|
||||
};
|
||||
|
||||
struct Plane {
|
||||
vec3 Normal;
|
||||
float d;
|
||||
};
|
||||
|
||||
struct Frustum {
|
||||
Plane Planes[4];
|
||||
};
|
||||
|
||||
layout (std430, binding = 1) buffer FrustumBuffer
|
||||
layout (std430, binding = 0) buffer FrustumBuffer
|
||||
{
|
||||
Frustum Frustums[80*45];
|
||||
};
|
||||
Frustum Data[3600];
|
||||
} Frustums;
|
||||
|
||||
layout (std430, binding = 3) buffer LightIndexBuffer
|
||||
{
|
||||
float LightIndexList[MAX_LIGHTS_PER_TILE*NUM_TILES];
|
||||
};
|
||||
|
||||
struct LightGrid
|
||||
{
|
||||
int Amount;
|
||||
int Start;
|
||||
vec2 padding;
|
||||
};
|
||||
|
||||
layout (std430, binding = 4) buffer LightGridBuffer
|
||||
{
|
||||
LightGrid LightGrids[NUM_TILES];
|
||||
};
|
||||
|
||||
layout (std430, binding = 5) buffer LightOffsetCounter
|
||||
{
|
||||
int GlobalLightOffsetCounter;
|
||||
};
|
||||
|
||||
|
||||
layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
|
||||
void main ()
|
||||
{
|
||||
if(gl_LocalInvocationIndex == 0) {
|
||||
LightIndexList[int(gl_WorkGroupID.x) + int(gl_WorkGroupID.y)*80] = int(gl_WorkGroupID.x);
|
||||
if(1 == 1) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user