Sign in to follow this  
Starfox

Antialiasing blitting problem

Recommended Posts

I have a rendering pipeline that goes:
Render to MSAA Renderbuffer -> blit to screen
I'm trying to change it to:
Render to MSAA Renderbuffer -> blit to Texture -> blit texture to screen

Both MSAA renderbuffer and texture are FP16. Here's how I create the texture:

glTextureImage2DEXT(ResolveTargetTexture, GL_TEXTURE_2D, 0, 4, ScreenWidth, ScreenHeight, 0, GL_RGBA, GL_HALF_FLOAT, NULL);

Now my resolve code was like this:


glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER, MultisampleFramebufferObject);
glBlitFramebufferEXT(0, 0, ScreenWidth, ScreenHeight, 0, 0, ScreenWidth, ScreenHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST);

And it worked perfectly. Changing it to this:


//
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, ResolveTargetFramebufferObject);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER, MultisampleFramebufferObject);
glBlitFramebufferEXT(0, 0, ScreenWidth, ScreenHeight, 0, 0, ScreenWidth, ScreenHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST);
//
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER, ResolveTargetFramebufferObject);
glBlitFramebufferEXT(0, 0, ScreenWidth, ScreenHeight, 0, 0, ScreenWidth, ScreenHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST);

Results in AA anomalies - the edges seem "thicker", for lack of a better word. I thought it might be related to Gamma AA, but on my test rig (NV GTX 260M 1 GB) I checked and gamma correct AA is set to off in the control panel. What am I doing wrong? Any idea where those anomalies might be coming from?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this