I hesitate a little to mention #3 above because it’s 10 years old and doesn’t make use of the latest GLSL/GL techniques. However, it does have some solid tutorials with source code describing how to accomplish specific tasks using shaders (including those that you mention above). All of them do really, though the last 2 focus more on the shader code.
Well basically, I cant get to work just a simple Shader with multiple lightsources. Struggling a lot mainly because I cant seem to grasp the problem or debug a faulty program. So basically I’ve came across a lot of examples around the web but I learned thar each GL version has its own variables and deprecated functions that lead me to struggle a lot more.
Secondary Issue is the fact that I don’t know the data types such as Mat2, Mat3 and so on.
Java (LWJGL) win 8.1 64x, with GL 3.2
Well, I only could set to work a simples shader where everything gets green/blue/red, basically setting gl_FragColor = vec4(1.0,2.0,0.0,1.0);
more than that, I just get weird and funky results.
But if I could just write a simple shader with lighting (multiple sources) using multiple textures (base one, and secondary ones as modulate effects, basically multiplying each pixel) I would be more than satisfied, at least having a pointer so I could manipulate the shader afterwards to my own needs. To start I would like to have something without Uniform Parameters.
That is also one of my main concerns, if what I’m aiming for could be limited by the fact that newer techniques could be either easier or better (performance-wise).
and thanks for the examples, the first one though is C#, so I think I would need to adapt it, but that has always been my main issue “adapt” and while not having any kind of debug info (in design time) I struggle to get to the problems in hand.
Ok, well you probably know this. But walk before you can run. Start simple. Debug that. Then build on that.
Put multiple light sources on the shelf for now. Get a single light source working (directional first, then point). The above books (especially the last two) will just flat tell you how. And there’s learning value in getting their examples to work, or just taking their working examples and “tweaking them” in different ways to see how things are wired together.
However, if any of: “N dot L” lighting, vectors, matrices (e.g. 3x3, 4x4, etc.), modeling and viewing transforms, object space, world space, or eye space are greek to you, you really should save yourself time and frustration, pick up a good book (see above) and do some reading. If something is confusing, ask questions here. There are a number of folks that read these forums that would be happy to answer specific questions.
I wouldn’t worry about using the absolute latest techniques when you’re learning. The GL driver implementation you’re using is only GL 3.2 anyway. You first need to get the high level picture in your head as to what the pieces are and how they all fit together. At this stage, just pick a GLSL version to target and stick with it. They’re not really that different. Since your implementation currently supports GL 3.2, then I’d just pick GLSL 1.5 (the corresponding GLSL version) and be done with it.