Skip to main content

Inb4 Clip Space

· One min read

Updates from the commit log

helios now has core vector operations: subtraction, dot product, cross product. The lookAt function constructs view matrices from eye, target, and up vectors, following standard methodology.

Performance

I benchmarked cross and lookAt since they're called frequently during rendering. The constexpr optimizations help, but glm is still faster - their optimizations go deeper than what I've implemented so far.

BenchmarkTimeCPUIterations
BM_vec3Constructor/real_time5.04 ns4.89 ns127,890,789
BM_glm_vec3Constructor/real_time4.25 ns4.07 ns161,100,528
BM_vec3Cross/real_time20.1 ns19.7 ns34,872,072
BM_glm_vec3Cross/real_time7.28 ns7.29 ns94,326,910
BM_vec3Dot/real_time12.2 ns11.8 ns57,045,623
BM_glm_vec3Dot/real_time10.1 ns9.81 ns70,071,613

Static

Had some symbol collisions from duplicate test function definitions. Using static to limit symbol scope to file level solved it - a simple fix from C that still works.