Original Post
Hi everyone, I'm trying to learn some of the new good habits of GLSL 1.30... but there is still one thing I don't understand. In the doc, it's said that the use of gl_FragData[n] is deprecated, and to use "out" instead. But how the hell can we know in which texture data is written. Let's take an exemple : with GLSL 1.20, when I want to write something using the FBO extension, I used to doing that : gl_FragData[0] = myVec41; gl_FragData[1] = myVec42; It was easy to know that the texture bounded to unit 1 has myVec41, and that texture bounded to unit 2 has myVec42. But how can we know now with GLSL 1.30 ? From what I've understood, it's something like that : I think that GLSL 1.30 is intelligent enough, so myVec41 will be written to the first active texture (because it is declared first), and myVec42 will be written to the second active texture (because it is declared second). Am I right ? Furthermore, what if I want to write myVec41 in a the third active unit, and myVec42 to the fourth one ? Thanks ;)
out vec4 myVec41;
out vec4 myVec42;
void main ()
{
// Don't use gl_FragData
}