Lots of fixes

This commit is contained in:
mcrcortex
2024-01-29 11:18:16 +10:00
parent c4efd29206
commit 6302d3db1e
9 changed files with 308 additions and 35 deletions

View File

@@ -49,22 +49,27 @@ layout(binding = 2, std430) writeonly restrict buffer DrawBuffer {
DrawCommand cmdBuffer[];
};
layout(binding = 3, std430) readonly restrict buffer SectionBuffer {
layout(binding = 3, std430) restrict buffer DrawCommandCountBuffer {
uint opaqueDrawCount;
uint translucentDrawCount;
};
layout(binding = 4, std430) readonly restrict buffer SectionBuffer {
SectionMeta sectionData[];
};
#ifndef VISIBILITY_ACCESS
#define VISIBILITY_ACCESS readonly
#endif
layout(binding = 4, std430) VISIBILITY_ACCESS restrict buffer VisibilityBuffer {
layout(binding = 5, std430) VISIBILITY_ACCESS restrict buffer VisibilityBuffer {
uint visibilityData[];
};
layout(binding = 5, std430) readonly restrict buffer ModelBuffer {
layout(binding = 6, std430) readonly restrict buffer ModelBuffer {
BlockModel modelData[];
};
layout(binding = 6, std430) readonly restrict buffer LightingBuffer {
layout(binding = 7, std430) readonly restrict buffer LightingBuffer {
uint lightData[];
};

View File

@@ -61,14 +61,6 @@ void main() {
cmd.firstIndex = 0;
cmd.baseVertex = int(extractQuadStart(meta))<<2;
cmd.baseInstance = encodeLocalLodPos(detail, ipos);
cmdBuffer[gl_GlobalInvocationID.x] = cmd;
} else {
DrawCommand cmd;
cmd.count = 0;
cmd.instanceCount = 0;
cmd.firstIndex = 0;
cmd.baseVertex = 0;
cmd.baseInstance = 0;
cmdBuffer[gl_GlobalInvocationID.x] = cmd;
cmdBuffer[atomicAdd(opaqueDrawCount, 1)] = cmd;
}
}

View File

@@ -14,4 +14,6 @@ void main() {
discard;
}
outColour = colour * colourTinting;
//outColour = vec4(uv + baseUV, 0, 1);
}

View File

@@ -83,9 +83,9 @@ void main() {
//TODO: make the face orientated by 2x3 so that division is not a integer div and modulo isnt needed
// as these are very slow ops
baseUV = modelUV + (vec2(face%3, face/3) * (1f/(vec2(3,2)*256f)));
uv = quadSize;// + faceOffset;//Add in the face offset for 0,0 uv
uv = quadSize + faceOffset;//Add in the face offset for 0,0 uv
discardAlpha = 1;
discardAlpha = 0;
//Compute lighting
colourTinting = getLighting(extractLightId(quad));