
Playing with multisampling
Posted Wednesday, 15 July, 2009 - 19:21 by nythrix inI have noticed that colors on multisampled renderbuffers are not accurate. It's probably because of pixels "blending" with each other, though I have no idea on how renderbuffers work so this is more of a guess. Anyway, here's a picture of 3 cubes, each rendered with a different sampling method. Top: no multisampling, left: 2 samples, right: 4 samples.
Is there a way of making them look the same?
Edit: I'm on a GL3+ context so I hope I can counter this effect on the pixel shader. No more ideas so far.


Comments
Re: Playing with multisampling
This looks more like a driver bug than anything.
Check your driver settings and try disabling things like "adaptive antialiasing" or "temporal antialiasing". What happens if you disable FSAA in code but force through the drivers?
Re: Playing with multisampling
I'm not expert in AA but how can you use it differently inside one window? AFAIK, the context is usually reset (by app reloading) in order to change AA quality.
Re: Playing with multisampling
Two ways I can think of: use multisampled framebuffer objects or use 3 different contexts at once.
Re: Playing with multisampling
OK, then the source code producing this bug could be helpful.
At least, we'd know whether nythrix uses blending somewhere or not.
Re: Playing with multisampling
Sorry, I updated my post during your reply.
Forcing the AA setting through the driver and specifying a different one in the code crashes the app (on GL.BlitFramebuffer) I can specify the driver's AA or no AA. It's not really overriding my app. Instead I get a good old kick in the teeth if I rebel:) Weird...
Anyway, turning "Antialiasing - Gamma correction" off fixes the problem. No idea what's that for, never messed with it.
Config: nVidia GT9600, ForceWare 186.16
Re: Playing with multisampling
Indeed, I use 3 FBOs with multisampled renderbuffers. Then I blit them into the framebuffer. I'm currently looking into fitting a raytracer in that window too. I can write down a short tutorial if there's interest.
Re: Playing with multisampling
Despite the problem is solved, you can try writing FBO textures to external BMP/TIF/TGA files to see what's in there.
Re: Playing with multisampling
Gamma correction tries to improves FSAA appearance of dark on light objects and vice versa. Imagine thin power lines hanging under of a bright sky: without gamma correction they will appear darker than they should.
In general, the effect is subtle and there are a few cases where it gamma correct FSAA looks worse. However, in most cases it looks better - this was considered one of the advantages of R500 over NV40 (IIRC).
It is possible that you've hit a driver bug (186 is still beta, I think?) You could try logging a bug or asking at the nvidia forums.
Edit: and yes, this seems to be a known issue, that could be considered a bug or not - depending on whom you ask. The specs are vague here.
Re: Playing with multisampling
Edit: and yes, this seems to be a known issue, that could be considered a bug or not - depending on whom you ask. The specs are vague here.
I was about to post the same thing. There's a lot of big words in that discussion which I'm not sure I fully understand. My knowledge on pixel processing is a bit limited. I only started with FBOs this morning.