This commit is contained in:
TheRealNull
2021-01-03 17:54:32 -05:00
parent de95668590
commit 1d461f38ff
35 changed files with 485 additions and 310 deletions

View File

@@ -29,8 +29,6 @@
layout(local_size_x = 6) in;
#include common.glsl
void main() {
uint groupId = gl_WorkGroupID.x;
uint localId = gl_LocalInvocationID.x;
@@ -41,9 +39,7 @@ void main() {
int outOffset = minfo.idx;
int uvOffset = minfo.uvOffset;
int flags = minfo.flags;
int orientation = flags & 0x7ff;
ivec4 pos = ivec4(minfo.x, minfo.y, minfo.z, 0);
if (localId >= size) {
return;
}
@@ -62,16 +58,12 @@ void main() {
thisC = tempvb[offset + ssboOffset * 3 + 2];
}
ivec4 thisrvA = rotate(thisA, orientation);
ivec4 thisrvB = rotate(thisB, orientation);
ivec4 thisrvC = rotate(thisC, orientation);
uint myOffset = localId;
// position vertices in scene and write to out buffer
vout[outOffset + myOffset * 3] = pos + thisrvA;
vout[outOffset + myOffset * 3 + 1] = pos + thisrvB;
vout[outOffset + myOffset * 3 + 2] = pos + thisrvC;
vout[outOffset + myOffset * 3] = pos + thisA;
vout[outOffset + myOffset * 3 + 1] = pos + thisB;
vout[outOffset + myOffset * 3 + 2] = pos + thisC;
if (uvOffset < 0) {
uvout[outOffset + myOffset * 3] = vec4(0, 0, 0, 0);
@@ -86,4 +78,4 @@ void main() {
uvout[outOffset + myOffset * 3 + 1] = uv[uvOffset + localId * 3 + 1];
uvout[outOffset + myOffset * 3 + 2] = uv[uvOffset + localId * 3 + 2];
}
}
}