From 7b0edcfc6a07ff4d64e602f2b68d93fedc8b826d Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 2 Aug 2026 16:11:30 +0200 Subject: fix(engine): improve portability by making matrices row-major --- engine/res/default_shader.slang | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'engine/res/default_shader.slang') diff --git a/engine/res/default_shader.slang b/engine/res/default_shader.slang index 04e897e..e42b83a 100644 --- a/engine/res/default_shader.slang +++ b/engine/res/default_shader.slang @@ -232,20 +232,11 @@ VertexStageOutput vertex_main(Vertex vertex: VERTEX) { VertexStageOutput stage_output; - // TODO: Investigate why mul arguments need to be ordered this way. - // The mul arguments are reordered in the GLSL output + float4x4 proj_view = mul(model_3d.projection, model_3d.view); - // float4x4 proj_view = mul(model_3d.projection, model_3d.view); - float4x4 proj_view = mul(model_3d.view, model_3d.projection); + float4x4 proj_view_model = mul(proj_view, model_3d.model); - // float4x4 proj_view_model = - // mul(proj_view, model_3d.model); - - float4x4 proj_view_model = mul(model_3d.model, proj_view); - - // stage_output.sv_position = mul(proj_view_model, float4(vertex.pos, 1.0)); - - stage_output.sv_position = mul(float4(vertex.pos, 1.0), proj_view_model); + stage_output.sv_position = mul(proj_view_model, float4(vertex.pos, 1.0)); float4 vertex_pos = float4(vertex.pos, 1.0); -- cgit v1.2.3-18-g5258