GLSL makes me so, so sad. Swizzling is pretty good, but beyond that it’s a consistent experience of “why would you make it this way? Who hurt you??”
So I wrote an embedded Haskell DSL which compiles to it. Not a perfect solution, but it typechecks shader vars against buffers.
Conversation
Oooh, reminds me a bit of "Geometry types for graphics programming":
2
3
Have you looked into geometric algebra before? It has some nicer properties than linear algebra, and could potentially work a bit better with this kind of thing.
2
1
Oh my bad, I have—or at least, of bivectors and rotors: marctenbosch.com/quaternions/
1
1
Yeah that's what I was thinking of! I used to try to understand a textbook at uni that went through it. I feel like the explanations leave a bunch to be desired, but it seems a bit more composable than linear algebra…? But yeah I could be misguided here.
1
1
made a cool library for it in Rust! I think it avoids some of the performance pitfalls I used to read about in that old textbook:
1
1
Indeed, though uv only implements enough to replace quaternions, it doesn't implement the whole 3d projective geometric algebra. I've been meaning to do that for some time but havent got around to it. In c++ there is Klein by which is awesome jeremyong.com/klein/
1
4
Oooh coool! Was not aware of this library, thanks! 😊
it would be nice to bind it to haskell (no pun intended)
1



