summaryrefslogtreecommitdiff
path: root/engine/res
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-08-02 16:11:30 +0200
committerHampusM <hampus@hampusmat.com>2026-08-02 17:52:03 +0200
commit7b0edcfc6a07ff4d64e602f2b68d93fedc8b826d (patch)
tree6077257d6a920c13ef62c22564343ae952ad81d7 /engine/res
parent3f9750edecad1615348d9ec0995a2fbde468c8a3 (diff)
fix(engine): improve portability by making matrices row-major
Diffstat (limited to 'engine/res')
-rw-r--r--engine/res/default_shader.slang15
1 files changed, 3 insertions, 12 deletions
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);