I’ve been writing shaders in Cg for quite a while, but when doing so in GLSL (which I’d like to switch to), I’m having some issues with lighting.
Basically, what space should I be feeding light positions in, what gets transformed by the GL, that sort of thing? I have grabbed up some simple lighting examples from places (lighthouse 3D, for instance, also the orange book), and I can’t seem to get it correct. It’s vexing me, as I have written FAR more complex shaders in Cg, and it’s difficult to get started when basic lighting isn’t working correctly.
I am using GL 2.1 and sending lights in through the GL lighting API, accessing them in the shader via the pre-defined variable names. I know these will go away in GL 3, but still…
Thanks all,
Keith