Enable Antialiasing

Started by
6 comments, last by Kambiz 14 years, 10 months ago
Hello there is this simple option for my videocard driver to set antialiasing (2x, 4x 8x, 16x, app-specific) This affects all my (self-written gl) apps (of course) I would like my app to contain this option. Ive searched for antialiasing in opengl, and I encounter things like simpy setting glHint etc, but nothing relating to the 2x 4x etc. (I understand what it is, what its supposed to do, but dont get the implementation like in normal 3d games etc) How can I get these options in my app (like normal games have) Is there something like EnableAntiAliasing (8x)... (I figure this is too simple and a stupid question... so sorry :) ) regards
Advertisement
I'm not an OpenGL person, but this Nehe tutorial seems to explain how to do it, and from reading the comments, it explains how to check for four samples and then drops back to two if four is not available, so perhaps this will help.

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=46
I have come across this article in the past, and Im bound to read up on it eventually :)

Though its exatly this sort of stuff that leaves me to wonder about another possible (simpler) call.
In the case of this article, the app itself has to do some considerable coding/work to get it to work, yet it also works fine without any of that, by just enabling the option in my videocard driverpanel....
Somehow the driverpanel app simply enables some global option (antialias everything 16x eg), affecting(/overriding) all apps, that themselves dont contain any supporting code for it...


Quote:Original post by Kincaid
I have come across this article in the past, and Im bound to read up on it eventually :)

Though its exatly this sort of stuff that leaves me to wonder about another possible (simpler) call.
In the case of this article, the app itself has to do some considerable coding/work to get it to work, yet it also works fine without any of that, by just enabling the option in my videocard driverpanel....
Somehow the driverpanel app simply enables some global option (antialias everything 16x eg), affecting(/overriding) all apps, that themselves dont contain any supporting code for it...


Umm, you know, that button on the driver panel...is not some magical "Anti Aliasing Turn On!" button. It does a lot of work behind the scenes....the SAME work you have to manually code to enable it on your application.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

thats what im asking...
what does it do ?
since any app with NONE of the code mentoined in the lesson or anywhere else, is perfectly antialiased by enabling this.
Certainly it doesnt go around including any code into all these programs. :)

so it seems it boils down to some general EnableAntiAlias (mode) call (which might be complex to the bone in its working) that I should be able to call also...

Quote:Original post by Kincaid
thats what im asking...
what does it do ?
since any app with NONE of the code mentoined in the lesson or anywhere else, is perfectly antialiased by enabling this.
Certainly it doesnt go around including any code into all these programs. :)

Although that's exactly what it does. All 3D related commands inevitably will go through the graphics driver, regardless of the application or game. And the driver is free to modify these commands. For example by injecting FSAA related states.

Quote:Original post by Kincaid
so it seems it boils down to some general EnableAntiAlias (mode) call (which might be complex to the bone in its working) that I should be able to call also...

Yep. It's the one that posters above already mentioned.
Quote:Original post by sybixsus
this Nehe tutorial seems to explain how to do it [...]

This is indeed how 99% of all developers do it, and although it works fine, it should be noted that technically speaking, it is wrong. But I guess there is no better way.

Function pointers and the extension string are only valid for the context they're created from (or a context that is identical in every respect).
Thus, you have no guarantee that any function pointer or extension advertised in the extension string that you got from "some accelerated context" works for any other context.
Luckily, reality is much more forgiving than theory, in reality it "just works" anyway.
Quote:Original post by Kincaid
thats what im asking...
what does it do ?


If you don't override it in the panel, then you'll just get a normal window back and you need to do all the querying to get a multisampled pixel format window. Presuambly, if you enable it in the panel, you will get such a window right from the start, without having a say about it, and the GL_MULTISAMPLE state will be automatically enabled for all draw calls. So no, there is no magical "enable fsaa now" button, unfortunately, but it shouldn't be hard to implement this.
If you are using FBOs you might also be interested in EXT_framebuffer_multisample.

This topic is closed to new replies.

Advertisement