FLTK logo

Re: [fltk.general] Antialiasing in gl_window class

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Antialiasing in gl_window class Greg Ercolano Jun 02, 2021  
 

On 6/2/21 1:27 PM, Ian MacArthur wrote:

This is more a GL question than a fltk one, really, I guess. Once you have your GL context in fltk, say in a Fl_Gl_Window, then what you draw in there is pretty much up to you.

As Bill says, FSAA is probably the way to go; basically create your frame buffer in some MSAA mode and then render your scene pretty much as normal and let the buffer take care of the AA for you...

    I've found opengl features in general are very machine specific.

    For instance my linux machine's OpenGL can't seem to do AA at all, even for
    simple line drawing. But on the mac it's much better.

    For instance to get the cube example to render wire frames with antialiasing,
    I added these to the cube_box::draw() !valid() section:

    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_LINE_SMOOTH);
    glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);

    ..here's the before and after:


    Despite I couldn't grab the cube at the same position + size between runs,
    you can see the jaggies clearly in the left image, and less so in the right.

    Here's a blowup of the above two images at 3x scale (using no interpolation) to see the details:

 

I wasn't able to get the flat polygon rendering to work, probably because of the reasons Bill mentioned,
and I wasn't sure how to enable full screen anti-aliasing; that seems to be a feature of the window,
and I'm not sure how to control that. I'm also not familiar with the "new" opengl stuff yet.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/e91cec56-c505-006e-285b-c833562c0324%40seriss.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.