how do I do antialised polygons/circles
BlitzMax Forums/BlitzMax Programming/how do I do antialised polygons/circles
| ||
Ok, So I have a progam that draws polygons and circles, but they're kind of ugly:![]() How do i get them antialised? (I use "drawoval" and "drawpolygon" to draw them). |
| ||
Enable FSAA? I understand lines are just stretched quads.. |
| ||
what's FSAA? How do you enable it? Please keep in mind that they're not images you paste, they're drawn with the "draw" commands |
| ||
From the NeHe tutorials (nr. 46): http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=46 For more specific information on anti-aliasing, as well as the information I'm about to present, please check out the following links: GDC2002 -- OpenGL Multisample OpenGL Pixel Formats and Multisample Antialiasing With that being said, a brief overview of how our process is going to work. Unlike other extensions, which relate to OpenGL rendering, the ARB_MULTISAMPLE extension must be dealt with during the creation of your rendering window. Our process shall go as follows: 1. Create our Window as normal 2. Query the possible Multisample pixel values (InitMultisample) 3. If Multisampling is available, destroy this Window and recreate it with our NEW pixelFormat 4. For parts we want to antialias, simply call glEnable(GL_ARB_MULTISAMPLE); Let's start off from the top, and talk about our source file arbMultiSample.cpp. We start off with the standard includes for gl.h & glu.h, as well as windows.h, we'll talk about arb_multisample.h later. Another source: http://fly.cc.fer.hr/~unreal/theredbook/chapter07.html Just found it by googling for "opengl anti-alias". |
| ||
I get there is no way to do it with Max2D? |
| ||
Sounds like it's an extension. There is such a thing as line antialiasing which probably would suffice. something like glEnable(GL_LINE_SMOOTH)? ... although you need to be in alpha blend I think.\ |
| ||
DirectXPrimaryDevice.device.SetRenderState D3DRS_EDGEANTIALIAS,True Example: Graphics 640,480,0,60 SetBlend(ALPHABLEND) PrimaryDevice.device.SetRenderState D3DRS_EDGEANTIALIAS,True DrawLine 10,10,100,600 Flip WaitKey() |
| ||
That snippet doesn't work tim. Complains about D3DRS_EDGEANTIALIAS not being found. |
| ||
Lol, you have to set the constant, seems Mark left it out.Const D3DRS_EDGEANTIALIAS=40 |
| ||
what about on openGL? |
| ||
I wonder if you need to enable GL_SMOOTH as the type of rendering, in order to make antialiased edges - like the FILTEREDIMAGE flag does for images. It might be that the polygons are being draw in in GL_FLAT mode. |
| ||
Example looks really good on my graphics card, however if you add an oval there is no improvement in this command at all?Const D3DRS_EDGEANTIALIAS=40 Graphics 640,480,0,60 SetBlend(ALPHABLEND) PrimaryDevice.device.SetRenderState D3DRS_EDGEANTIALIAS,True DrawLine 10,10,100,600 DrawOval 100,100,50,50 Flip WaitKey() |