first commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
#extension GL_ARB_shader_storage_buffer_object : enable
|
||||
|
||||
layout(std430, binding = 0) SSBO_QUALIFIER buffer blockDataBuffer {
|
||||
uvec4 data[];
|
||||
} blockDataSSBO;
|
||||
@@ -0,0 +1,34 @@
|
||||
#define SSBO_QUALIFIER
|
||||
|
||||
#if WORLD_SPACE_PLAYER_REF == 1
|
||||
#include "/lib/voxelization/SSBOs/playerVerticesBuffer.glsl"
|
||||
#endif
|
||||
|
||||
#include "/lib/voxelization/SSBOs/wsrBuffer.glsl"
|
||||
#include "/lib/voxelization/SSBOs/wsrLodBuffer.glsl"
|
||||
|
||||
#if COLORED_LIGHTING < 512
|
||||
const ivec3 sceneVoxelVolumeSize = ivec3(COLORED_LIGHTING_INTERNAL, 64, COLORED_LIGHTING_INTERNAL);
|
||||
#else
|
||||
const ivec3 sceneVoxelVolumeSize = ivec3(512, 64, 512);
|
||||
#endif
|
||||
|
||||
void clearSSBOs() {
|
||||
int pixelIndex = int(gl_FragCoord.x) + int(viewWidth) * int(gl_FragCoord.y);
|
||||
|
||||
int k = sceneVoxelVolumeSize.x * sceneVoxelVolumeSize.y * sceneVoxelVolumeSize.z / 32;
|
||||
if (pixelIndex < k) {
|
||||
if (pixelIndex < k / 64)
|
||||
wsrLodSSBO.bitmasks[pixelIndex] = 0u;
|
||||
|
||||
wsrSSBO.bitmasks[pixelIndex] = 0u;
|
||||
}
|
||||
|
||||
#if WORLD_SPACE_PLAYER_REF == 1
|
||||
if (pixelIndex == 0) {
|
||||
playerVerticesSSBO.bounds = playerBounds(ivec3(1e6), ivec3(-1e6), ivec3(1e6), ivec3(-1e6),
|
||||
ivec3(1e6), ivec3(-1e6), ivec3(1e6), ivec3(-1e6),
|
||||
ivec3(1e6), ivec3(-1e6), ivec3(1e6), ivec3(-1e6));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#extension GL_ARB_shader_storage_buffer_object : enable
|
||||
|
||||
struct playerBounds {
|
||||
ivec3 headMin, headMax;
|
||||
ivec3 torsoMin, torsoMax;
|
||||
ivec3 leftLegMin, leftLegMax;
|
||||
ivec3 rightLegMin, rightLegMax;
|
||||
ivec3 leftHandMin, leftHandMax;
|
||||
ivec3 rightHandMin, rightHandMax;
|
||||
};
|
||||
|
||||
layout(std430, binding = 3) SSBO_QUALIFIER buffer playerVerticesBuffer {
|
||||
vec3 vertexPositions[216];
|
||||
vec2 vertexData[216];
|
||||
playerBounds bounds;
|
||||
} playerVerticesSSBO;
|
||||
@@ -0,0 +1,5 @@
|
||||
#extension GL_ARB_shader_storage_buffer_object : enable
|
||||
|
||||
layout(std430, binding = 1) SSBO_QUALIFIER buffer wsrBuffer {
|
||||
uint bitmasks[];
|
||||
} wsrSSBO;
|
||||
@@ -0,0 +1,5 @@
|
||||
#extension GL_ARB_shader_storage_buffer_object : enable
|
||||
|
||||
layout(std430, binding = 2) SSBO_QUALIFIER buffer wsrLodBuffer {
|
||||
uint bitmasks[];
|
||||
} wsrLodSSBO;
|
||||
Reference in New Issue
Block a user