NVidia Framebuffer Attachments Color Location

Hello Forums,

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 :()

Thanks

Related?:

That could be the same / similar issue…

It seems like that the attachment locations are also broken there, also NVidia.

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.

So what is your draw buffers state?

I was just experimenting and unterstood glDrawBuffers finally! :smiley:

And yes I derped because I thought you just give it the locations it should “activate”.
Like {GL_COLOR_ATTACHMENT3} and loation 3 is active.

But it’s totally different I just noticed the hard way…

Anyway, thanks for support :slight_smile:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.