Just tried out multitexturing with glsl on my Nvidia Geforce Go 7400 - it won't work! Apparently, only the first texture unit is used. Probably I got something fundamentally wrong somewhere, so now I am asking for help in understanding all this. According to http://en.wikipedia.org/wiki/Comparison_of_NVIDIA_Graphics_Processing_Units#GeForce_Go_7_series , the chip has 4 "Texture mapping units" - isn't that what "uniform sampler2D" in glsl refers to? If so, shouldn't the following produce a texture blended halfway between the textures in units 0, and 1?
It doesn't really work, apparently it only interpolates between TextureUnit0 and TextureUnit0 again (I found this out when playing with the texture coordinates).
It won't work in an other program (Typhoon Lab's ShaderDesigner), as well, so it's definitely not a jME problem. Still, I thought it might be most appropriate in Effects, since it is not really what I'd call "Offtopic"...
Being totally "noob" to glsl, I didn't. That solved my problem, thanks! Actually, I was wondering how my program's supposed to know about the texture units, but didn't figure I had to set them as uniforms. The tutorial I thought to be a good starting point didn't mention this, either (or maybe I just read over it…). I assume this is not jME-specific, but common in openGL?
EDIT: Nevermind, on a second thought it's actually quite obvious that you'll have to set uniforms when you use the "uniform" keyword… Oh well, looks like I should put that to rest for today, and get a little distraction, before I continue to embarrass myself in public!
Its good that it works. Just a thing to note. Some GLSL implementations are broken (for example ATI on my laptop), and only the first 8 characters in uniform/attribute names are considered. So if i may suggest using "Tex0Unit" and "Tex1Unit" instead of "TextureUnit0" and "TextureUnit1". Its damn hard to find these kind of bugs.
It says that the max length of uniform/attribute names is implementation specific, and provides functions for getting the length. On the other hand i doubt ATI has implemented this as 8 characters. Its more of a bug. The compiler accepts more than 8 character names, but if two names dont differ in their first 8 characters, the result isnt what its supposed to be.