Drawing Meshes with Antialiasing?

I am drawing meshes fairly straightforwardly, but they are drawing without antialiasing.

I set up the window like this

    ofGLWindowSettings settings;
    settings.setGLVersion(3, 2);

I’m constructing and drawing my meshes like this

// create the mesh
ofVboMesh mesh;
// add a bunch of vertices

I’ve also tried drawing to an FBO, so I can force multisampling

allocated like this
_fbo.allocate(width, height, GL_RGBA, 4);

and then drawing like this

 ofClear(25, 25, 30, 255);

And this is still pixellated.

Am I doing anything obvious wrong?
What should I be doing to draw meshes with antialiasing?

not sure your exact issue but can you try:

 ofClear(25, 25, 30, 255);

what you may be seeing is the alpha from the edges of shapes in the fbo that gets rendered again when you draw the fbo (ie, the alpha from the edge of the mesh adjust the alpha of the fbo pixel and when you draw the fbo that pixel is not 100% opaque)

hope that helps!

Thanks for the suggestion - this doesn’t seem to fix it though. - 100% jagged pixels all the way.

This sounds like a driver issue, what platform are you on? OS, graphics card…

Thanks Arturo
Platform: Win 10
Graphics card: Nvidia Quadro K1100M and Intel HD Graphics 4600

there’s an option in the nvidia properties in windows to choose the nvidia card to run an specific application can you try to find the example you are trying to run there and set it to run with nvidia rather than intel?

Also try updating the intel drivers

Hi Arturo,
Thanks for your advice. I just tried this out

  • with updated intel drivers and intel card selected for the app: still aliased
  • with nvidia card selected for the app: antialiasing

I’m hoping to make this app publicly available - so I’m wondering if the line smoothing behaviour is consistent across most graphics cards (e.g. the NVIDIA result is what I should expect people to see and the intel 4600 is an oddity), or is there something I need to do if I want the software to present consistently?

This usually works and is supported by most hardware, I would also check that you haven’t forced disabled multisampling antialiasing in the intel driver control panel

thanks Arturo - that’s really helpful and good to know. I just tested it on another machine and it looks fine - so I guess I got unlucky with my main machine’s config. I’ll check out the intel control panel.