Jump to content
  • Advertisement
Sign in to follow this  
Kincaid

OpenGL Enable Antialiasing

This topic is 3335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...


Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!