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 Ian MacArthur Jun 02, 2021  
 
On 2 Jun 2021, at 02:25, adonis192 wrote:
> 
> Dear FLTK team,
> 
> There is no way to implement antialiasing functions on polygon-based OpenGL drawings in the FLTK 1.3.X series in order to get better scenes? I have not tried ti use GLUT, I would like just using the gl_window class instead.

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’d guess you can probably do that with a texture created in GL_TEXTURE_2D_MULTISAMPLE mode or something, but looking back at my own code, that last time I did this it looks like I just used GL_TEXTURE_2D but then set up the framebuffer with 

glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER, 4, GL_RGBA8, imageWidth, imageHeight);

And that seems to have pretty much worked (the code in question dates back to 2013, I do not recall anything about why I did things the way I did...) and the program runs fine, seems to be smooth and swift, and the image is definitely AA.

That said, to get any more advanced capabilities out of an Fl_Gl_Window you will probably need some sort of GL extension wrangler to support that (I use GLEW) as the host platforms oftentimes do not expose any GL API beyond 1.3 or some such by default (though possibly the later OSX/macOS versions do support GL3 or such without any messing about.)

There’s a few samples in the fltk “examples" folder (that I think Manolo did) that deliberately try to use GL3 API just to see it work (OpenGL3-glut-test.cxx and OpenGL3test.cxx) so you can try building them and see how you get on. On this old Mac they seem to Just Work, and report the GL API level as:
GL_VERSION=4.1 ATI-1.68.25
Shading Language Version=4.10

FWIW, on Win10 with mingw I *always* have to use GLEW to get advanced GL API’s, but I have no clue what the MS VS tools will do.


-- 
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/FCA0D158-8F51-49A2-BF22-22FFB3CF71DD%40gmail.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'.