optimized faces

This commit is contained in:
maxwes08
2025-12-15 10:14:16 +01:00
parent 0641d22c9b
commit f532eddfbb
11 changed files with 107 additions and 141 deletions

View File

@@ -72,8 +72,8 @@ namespace Voxel
byte[] data = chunkMesh.GetPackedData();
GL.BufferSubData(BufferTarget.ShaderStorageBuffer,
(IntPtr)(faceOffset * 8), // faceOffset * 8 = byte offset
chunkMesh.Size * 8,
(IntPtr)(faceOffset * 4), // faceOffset * 4 = byte offset
chunkMesh.Size * 4,
data
);
@@ -83,28 +83,7 @@ namespace Voxel
private static void RenderUi()
{
GL.Disable(EnableCap.DepthTest);
GL.Enable(EnableCap.Blend);
GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
//_uiShader.Use();
//Matrix4 projection = Matrix4.CreateOrthographicOffCenter(
// 0, screenWidth, screenHeight, 0, -1, 1);
//_uiShader.SetMatrix4("projection", projection);
// Bind UI texture atlas
//_uiTexture.Bind();
// Draw all UI sprites (batch by texture for efficiency)
//foreach (var sprite in _uiSprites)
//{
// sprite.Draw();
//}
// Restore 3D settings
GL.Disable(EnableCap.Blend);
GL.Enable(EnableCap.DepthTest);
}
private static void RenderWorld()