fix: remove row_major from GLSL — fixes fish-eye and broken projection
Root cause: System.Numerics.Matrix4x4 uses row-major storage with row-vector convention (v * M). GLSL with layout(row_major) does column-vector (M * v), which effectively transposes the matrix, breaking the projection. Fix: remove row_major from layout qualifiers. GLSL then interprets the row-major data as column-major (effectively transposing it), so M * v in GLSL equals v * M in System.Numerics — correct result. The Y-flip (M22 *= -1) is still needed for Vulkan's Y-down clip space.
This commit is contained in:
@@ -6,11 +6,11 @@ layout(location = 2) in vec3 inNormal;
|
|||||||
|
|
||||||
layout(location = 0) out vec3 fragColor;
|
layout(location = 0) out vec3 fragColor;
|
||||||
|
|
||||||
layout(row_major, set = 0, binding = 0) uniform CameraUBO {
|
layout(set = 0, binding = 0) uniform CameraUBO {
|
||||||
mat4 vp;
|
mat4 vp;
|
||||||
};
|
};
|
||||||
|
|
||||||
layout(row_major, push_constant) uniform PC {
|
layout(push_constant) uniform PC {
|
||||||
mat4 model;
|
mat4 model;
|
||||||
} pc;
|
} pc;
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user