optimized faces
This commit is contained in:
27
Renderer.cs
27
Renderer.cs
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user