voxel perspective

This commit is contained in:
Jorijn van der Graaf 2025-06-10 22:52:17 +02:00
commit f35acb58a7

View file

@ -72,14 +72,14 @@ void main()
uint oldVertexOffset = old*8;
gl_MeshVerticesEXT[oldVertexOffset + 0].gl_Position = vec4(xF - 0.5, yF - 0.5, zF - 0.5, 1.0); // Vertex 0
gl_MeshVerticesEXT[oldVertexOffset + 1].gl_Position = vec4(xF + 0.5, yF - 0.5, zF - 0.5, 1.0); // Vertex 1
gl_MeshVerticesEXT[oldVertexOffset + 2].gl_Position = vec4(xF + 0.5, yF + 0.5, zF - 0.5, 1.0); // Vertex 2
gl_MeshVerticesEXT[oldVertexOffset + 3].gl_Position = vec4(xF - 0.5, yF + 0.5, zF - 0.5, 1.0); // Vertex 3
gl_MeshVerticesEXT[oldVertexOffset + 4].gl_Position = vec4(xF - 0.5, yF - 0.5, zF + 0.5, 1.0); // Vertex 4
gl_MeshVerticesEXT[oldVertexOffset + 5].gl_Position = vec4(xF + 0.5, yF - 0.5, zF + 0.5, 1.0); // Vertex 5
gl_MeshVerticesEXT[oldVertexOffset + 6].gl_Position = vec4(xF + 0.5, yF + 0.5, zF + 0.5, 1.0); // Vertex 6
gl_MeshVerticesEXT[oldVertexOffset + 7].gl_Position = vec4(xF - 0.5, yF + 0.5, zF + 0.5, 1.0); // Vertex 7
gl_MeshVerticesEXT[oldVertexOffset + 0].gl_Position = ubo.modelProjectionView * vec4(xF - 0.5, yF - 0.5, zF - 0.5, 1.0); // Vertex 0
gl_MeshVerticesEXT[oldVertexOffset + 1].gl_Position = ubo.modelProjectionView * vec4(xF + 0.5, yF - 0.5, zF - 0.5, 1.0); // Vertex 1
gl_MeshVerticesEXT[oldVertexOffset + 2].gl_Position = ubo.modelProjectionView * vec4(xF + 0.5, yF + 0.5, zF - 0.5, 1.0); // Vertex 2
gl_MeshVerticesEXT[oldVertexOffset + 3].gl_Position = ubo.modelProjectionView * vec4(xF - 0.5, yF + 0.5, zF - 0.5, 1.0); // Vertex 3
gl_MeshVerticesEXT[oldVertexOffset + 4].gl_Position = ubo.modelProjectionView * vec4(xF - 0.5, yF - 0.5, zF + 0.5, 1.0); // Vertex 4
gl_MeshVerticesEXT[oldVertexOffset + 5].gl_Position = ubo.modelProjectionView * vec4(xF + 0.5, yF - 0.5, zF + 0.5, 1.0); // Vertex 5
gl_MeshVerticesEXT[oldVertexOffset + 6].gl_Position = ubo.modelProjectionView * vec4(xF + 0.5, yF + 0.5, zF + 0.5, 1.0); // Vertex 6
gl_MeshVerticesEXT[oldVertexOffset + 7].gl_Position = ubo.modelProjectionView * vec4(xF - 0.5, yF + 0.5, zF + 0.5, 1.0); // Vertex 7
uint oldPrimOffset = old*12;