8
votes

I have a problem with different visual results when using a FBO compared to the default framebuffer:

I render my OpenGL scene into a framebuffer object, because I use this for color picking. The thing is that if I render the scene directly to the default framebuffer, the output on the screen is quite smooth, meaning the edges of my objects look a bit like if they were anti-aliased. When I render the scene into the FBO and afterwards use the output to texture a quad that spans the whole viewport, the objects have very hard edges where you can easily see every single colored pixel that belongs to the objects.

Good:

dtizcto7.png

Bad:

wy7hg754.png

At the moment I have no idea what the reason for this could be. I am not using some kind of anti-aliasing.

System:
Fedora 18 x64
Intel HD Graphics 4000 and Nvidia GT 740M (same result)

Edit1:

As stated by Damon and Steven Lu, there is probably some kind of anti-aliasing enabled by the system by default. I couldn't figure out so far how to disable this feature.
The thing is that I was just curious why this setting only had an effect on the default framebuffer and not the one handled by the FBO. To get anti-aliased edges for the FBO too, I will probably have to implement my own AA method.

1
This looks perfectly normal. You have probably enabled MSAA in the grasphic card's control panel (some setting like "override application" or "force always on"), which is why the render-to-screen looks antialiased. Rendering to a FBO does not use multisampling, unless you explicitly tell OpenGL to do so by adding multisample attachments.Damon
@Damon: Answers. Post answers, not comments.Nicol Bolas
What's wrong with posting a comment? If you're so certain his comment is accurate and answers the question completely, post it yourself.user1508519
@Damon: Thx, I thought of that too, but I the Intel Graphics relies on Mesa and the Nvidia card brings its own OpenGL implementation as far as I know. The consequence would be that this should effect only one of them. Edit: Is there a way to check whether AA is enabled or not?TimV
It must then be some setting your program or environment sets that enables AA on the frame buffer.Steven Lu

1 Answers

7
votes

Once you draw your scene into custom FBO the externally defined MSAA level doesn't apply anymore.You must configure your FBO to have Multi-sample texture or render buffer attachments setting number of sample levels along the way.Here is a reference.