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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user