From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: lablgtk at yquem.inria.fr Subject: Re: [Lablgtk] OpenGL support Date: Thu, 21 Jun 2007 02:51:26 +0100 References: <200706200549.51387.jon at ffconsultancy.com> <20070620.165538.15269611.garrigue at math.nagoya-u.ac.jp> In-Reply-To: <20070620.165538.15269611.garrigue at math.nagoya-u.ac.jp> Cc: Jacques Garrigue MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706210251.26856.jon at ffconsultancy.com> Content-Type: text/plain; charset="iso-8859-1" Content-Length: 2370 On Wednesday 20 June 2007 08:55:38 Jacques Garrigue wrote: > From: Jon Harrop > > What is the current state of OpenGL support in GTK and LablGTK? I'd like > > to use multisampling (antialiasing) but there aren't any controls for > > this in the current implementation. > > Antialiasing is already supported in lablGL itself, just as described > in the red book. > http://glprogramming.com/red/chapter06.html#name2 > > I've added an example as lablgtk/examples/GL/aargb.ml. > > Or are you talking about something else? I am talking about something else, but related. :-) The point, line and polygon smoothing that you refer to is a form of antialiasing that works well but only under certain circumstances (ordered geometries that don't overlap or abut, rendered without transparency) and is often not hardware accelerated on consumer-level hardware. Full Screen Anti-Aliasing (FSAA) was introduced to OpenGL in the form of SGIS_multisample in 1994: http://www.opengl.org/registry/specs/SGIS/multisample.txt evolved into an ARB extension in 1999: http://www.opengl.org/registry/specs/ARB/multisample.txt and became standard in OpenGL 1.3 in 2001 and is now hardware-accelerated even by consumer-level hardware. So FSAA is now the best way to provide fast and high-quality antialiasing of whole scenes. The method effectively renders the image at higher resolution and downsamples it, entirely in hardware. I just discovered that freeglut itself (the glut implementation that I'm using) ignores the value of "multisamples" that it is given. So this was not LablGlut's fault! I've implemented this in freeglut and multisampling now works fine under LablGLUT. That leaves CamlSDL and LablGTK. I'll look into these... Incidentally, is the gtkglarea vs gtkglext controversy still in the same state that it was 2 years ago? i.e. that glarea is officially deprecated but it still works fine so we're still using it? The gtkglext page says: "Unlike Jane Loff's GtkGLArea, GtkGLExt provides a GtkWidget API which enables OpenGL drawing for standard and custom GTK+ widgets." - http://www.k-3d.org/gtkglext/Main_Page What does that actually mean? Can you not use the existing GLarea as a widget? -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. The OCaml Journal http://www.ffconsultancy.com/products/ocaml_journal/?e