Conversation

> OpenGL Shading Language is a high-level shading language with a syntax based on the C programming language. "high-level" and "based on C" in the same sentence? Something wrong isn't right.
8
29
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.
2
4
(I also get free coordinate system checks, like if it’s in world space you have to give it a transform between that and screen space, which you can only obtain by composition step by step.)
1
2
Honestly I think we shouldn’t talk about matrices in the context of graphics programming before we’ve talked about transforms-as-categories, or rather, -as-paths-between-frames-of-reference. The encoding as a table of numbers can come later. (In my uneducated & untested opinion.)
3
2
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
Show replies