From 8ecd9b3f41ab973560b5732f8607d6601c0f8715 Mon Sep 17 00:00:00 2001 From: Joseph Merdrignac Date: Tue, 17 Jan 2023 15:07:35 +0100 Subject: [PATCH] skip useless normalize() Since `uu` & `ww` are already othogonal and normalized, we don't need to normalize the result of `cross(uu, ww)` --- index.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.glsl b/index.glsl index 1b82e55..b6cbfe1 100644 --- a/index.glsl +++ b/index.glsl @@ -2,7 +2,7 @@ mat3 calcLookAtMatrix(vec3 origin, vec3 target, float roll) { vec3 rr = vec3(sin(roll), cos(roll), 0.0); vec3 ww = normalize(target - origin); vec3 uu = normalize(cross(ww, rr)); - vec3 vv = normalize(cross(uu, ww)); + vec3 vv = cross(uu, ww); return mat3(uu, vv, ww); }