fix: correct matrix order (proj*view) + Z depth range for Vulkan

- VP matrix order: proj*view (GLSL column-vector convention)
- Z correction in vertex shader: gl_Position.z = (z+w)*0.5 (OpenGL [-1,1] → Vulkan [0,1])
- Depth test temporarily disabled for debugging
This commit is contained in:
emil28092005
2026-06-18 12:47:20 +03:00
parent d620bd537f
commit aca8d1ab4d
4 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -273,8 +273,8 @@ internal sealed unsafe class VulkanRenderer : IRenderer, Engine.Graphics.IScreen
{
var aspect = (float)_swapchain.Extent.Width / (float)_swapchain.Extent.Height;
var proj = Matrix4x4.CreatePerspectiveFieldOfView(MathF.PI / 4f, aspect, 0.1f, 100f);
var view = Matrix4x4.CreateLookAt(new Vector3(0, 0, -3), Vector3.Zero, Vector3.UnitY);
return view * proj;
var view = Matrix4x4.CreateLookAt(new Vector3(0, 0, 3), Vector3.Zero, Vector3.UnitY);
return proj * view;
}
private static void TransitionImageLayout(VkCommandBuffer cmd, VkImage image,