I ran into something weird, or something that I don't know how it works exactly.
What I want to do when rendering to multiple targets is that I selectively write to certain color buffers in my shader, but leave others alone.
Code :gl_FragData = vec4(0,1,0,1);
without setting the fragment data for the first 3 buffers...
This doesn't seem to go well. for example, if I don't explicity set a value in the color buffer 4, it seems to copy the color value from the first color buffer for some reason instead of leaving it alone.
So I though: ok I HAVE to explicitly set all a value on all used color buffers, so then if I don't want to touch one of the buffers, I just use blending and I write a value with an alpha of 0, so it doesn't effect the buffer. This doesn't work as expected.
It seems that the blending only looks at the color buffer 0 ? if I write a some color-value with an alpha of 0 to the color buffer 0, it doesn't seem to matter what I write to the other buffers, it doesn't write anything.
So not sure if you can follow what I'm explaining, but bottom line is: I would like to selectively write to certain color buffers in my shaders, and leave the other alone. Any ideas on how to do that properly? Or am I trying something impossible and do I need another solution?