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.
| Benchmark | Time | CPU | Iterations |
|---|---|---|---|
| BM_vec3Constructor/real_time | 5.04 ns | 4.89 ns | 127,890,789 |
| BM_glm_vec3Constructor/real_time | 4.25 ns | 4.07 ns | 161,100,528 |
| BM_vec3Cross/real_time | 20.1 ns | 19.7 ns | 34,872,072 |
| BM_glm_vec3Cross/real_time | 7.28 ns | 7.29 ns | 94,326,910 |
| BM_vec3Dot/real_time | 12.2 ns | 11.8 ns | 57,045,623 |
| BM_glm_vec3Dot/real_time | 10.1 ns | 9.81 ns | 70,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.