I have a weird behavior on my NVidia graphics card with Frame Buffer Objects. I have a frag shader emiting a blue color on out location = 1 and an orange color on out location 5. I create a fbo with one color attachment on location GL_COLOR_ATTACHMENT5. I would expect it to show the orange color, because it is bound to loation 5, but it is showing the blue one.
It seems that NVidia fbo color attachments are ignoring the location and binding the attachments “in order” (1, 2, 3…). I would apreciate it if someone would confirm/deny it on NVidia and other platforms. Also I can only test this with Java and LWJGL2, but I don’t think that matters (LWJGL is a direct opengl wrapper for java)
My system specs:
Dell Latitude 6520 (Notebok)
Intel i7 2640m
NVidia Quadro 4200M (96 cores, 512 mb only :()
I have a frag shader emiting a blue color on out location = 1 and an orange color on out location 5. I create a fbo with one color attachment on location GL_COLOR_ATTACHMENT5. I would expect it to show the orange color, because it is bound to loation 5, but it is showing the blue one.
Why would you expect that? The color attachment number and the fragment shader output location don’t mean anything. What gives them meaning is the framebuffer’s draw buffers state defined by glDrawBuffers. That’s what sets the mapping between fragment shader output locations and framebuffer attachments.