summaryrefslogtreecommitdiff
path: root/src/effects/rotating_cube_effect.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects/rotating_cube_effect.h')
-rw-r--r--src/effects/rotating_cube_effect.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/effects/rotating_cube_effect.h b/src/effects/rotating_cube_effect.h
index e773025..920be5c 100644
--- a/src/effects/rotating_cube_effect.h
+++ b/src/effects/rotating_cube_effect.h
@@ -28,6 +28,14 @@ class RotatingCube : public Effect {
vec2 resolution;
float aspect_ratio;
float _pad;
+
+ // Transpose matrices: mini_math is row-major, WGSL expects column-major.
+ static Uniforms make(const mat4& vp, const vec4& cam_pos_time,
+ const vec4& p, const vec2& res, float asp) {
+ return {mat4::transpose(vp), mat4::transpose(vp.inverse()),
+ cam_pos_time, p,
+ res, asp};
+ }
};
static_assert(sizeof(Uniforms) == 176, "Uniforms size mismatch");