PDA

View Full Version : NVidia Framebuffer Attachments Color Location



Firestar99
06-11-2016, 09:31 AM
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

Dark Photon
06-13-2016, 07:46 AM
Related?:
* https://www.opengl.org/discussion_boards/showthread.php/198520-Issue-with-glDrawBuffers-when-setting-one-of-the-entries-to-GL_NONE?p=1282946&viewfull=1

Firestar99
06-14-2016, 10:57 AM
That could be the same / similar issue...

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

Alfonse Reinheart
06-14-2016, 11:07 AM
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 (https://www.opengl.org/wiki/Framebuffer_Draw_Buffer) defined by `glDrawBuffers`. That's what sets the mapping between fragment shader output locations and framebuffer attachments.

So what is your draw buffers state?

Firestar99
06-14-2016, 11:54 AM
I was just experimenting and unterstood glDrawBuffers finally! :D

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