PDA

View Full Version : AntiAlias + Light + Benchmark



DarkShadow44
09-17-2009, 01:08 PM
Hi.
How can I use AntiAlias ?

I found some versions, but
1.) The sides where transparent
2.) There where black lines between all Faces...


How can I use AntiAlias without this bad effects ??


And HOW can I use Lights ???
I want to create a light, that makes the head of the player brighter... how could I do this ?


And, how much power (CPU/GPU) do Lights/AntiAlias need ? Very much ?

So how can I test how many models/Vertices I can load ?

Is the power management of OpenGl as good as that of DirectX ?

Which are the best OpenGL drivers (best SDK) for a Nvidia GeForce 6200 ?

And is it better to use QUADS instead of TRIANGLES ?

Sorry for this long post, so many questions and so much themes, but I would be VERY happy if you could answer some of them...

Please help !! :sorrow:

Dark Photon
09-19-2009, 09:15 AM
Hi.
How can I use AntiAlias without this bad effects ??
Please give us more detail on the aliasing your seeing. It's not clear what kind of antialiasing you think you need


And HOW can I use Lights ???
You need this: OpenGL Programming Guide (http://www.amazon.com/OpenGL-Programming-Guide-Official-Learning/dp/0321552628/ref=sr_1_1?ie=UTF8&s=books&qid=1253376787&sr=1-1)


So how can I test how many models/Vertices I can load ?
Depends on how you load them. Try it and see!


And, how much power (CPU/GPU) do Lights/AntiAlias need ? Very much ?
Is the power management of OpenGl as good as that of DirectX ?
Which are the best OpenGL drivers (best SDK) for a Nvidia GeForce 6200 ?
This is all up to your GPU vendor, and you if you write your own lighting shaders.

Download the latest drivers from http://developer.nvidia.com, install, and go from there.

DarkShadow44
09-19-2009, 10:46 AM
If I use GL_POLYGON_SMOOTH with GL_NICEST, my models are transparent and I see black lines were the different trianges are...

So I want to know how I can use Anti-Alias without transparence / lines .

How can I use the accummulation buffer to do Anti-Alias ?

And how can I set the level of Anti-Aliasing (like in may aames 2/4/8/16) ?

Dark Photon
09-19-2009, 11:19 AM
If I use GL_POLYGON_SMOOTH with GL_NICEST, my models are transparent and I see black lines were the different trianges are...
Are what? That's the critical piece we need.

See these links:

* http://www.opengl.org/wiki/GLSL_:_common_mistakes#GL_LINE_SMOOTH.2C_GL_POINT_ SMOOTH_.2C_GL_POLYGON_SMOOTH
* http://www.opengl.org/wiki/Multisampling

My guess is you need to just use a multisample antialiasing (aka MSAA) mode instead, and drop POLYGON_SMOOTH.


And how can I set the level of Anti-Aliasing (like in may aames 2/4/8/16) ?
Yep, that's typically MSAA. The number is typically the number of (multi)samples per pixel.

See the second URL above. If that doesn't cut it for you, tell us: 1) whether you want to MSAA render in an FBO or in the system framebuffer, and 2) if the latter, which platform you're on.

DarkShadow44
09-19-2009, 12:42 PM
What does FBO mean ?

I want to Antialias my Model with windows...

Can you explain me how I can do this best (MSAA ?), and how I can set the level of AA ?

But first please tell me how to enable/disable it, I don't understand it... :o

Dark Photon
09-19-2009, 05:44 PM
What does FBO mean ?
Framebuffer Object. It's used for off-screen rendering. If you're trying to render directly into an on-screen operating system window, you're not using an FBO.

Given that, you need to use your OS's GL/window system library to allocate a window with a pixel format that supports MSAA, and you need to enable multisample rasterization. Once you get the former, the latter is standard: glEnable( GL_MULTISAMPLE ).


I want to Antialias my Model with windows...
Ah, ok. That means you need to use the wgl (Windows GL interface) routines to help to get a window set up with a multisample pixel format. See this this NeHe tutorial (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=46), or that Multisampling wiki page (opengl.org) (http://www.opengl.org/wiki/Multisampling). For specific help someone else will have to chime in, as I use Linux (which of course doesn't use wgl).


I don't understand it... :o
Coding details aside, the concept of MSAA is really simple. So you don't like those pixel-accurate blocky edges on the edge of your polygons? Why not sample them at more than one location in a pixel, and then blend those samples together. Gives you smoother edges, more like what you'd see if your screen wasn't made up of pixels.

DarkShadow44
09-20-2009, 03:26 AM
Does a normal example use FBO ?
Do you mean with "off scren rendering" that my programm renders object with are not on the screen ??


Why not sample them at more than one location in a pixel, and then blend those samples together. Gives you smoother edges, more like what you'd see if your screen wasn't made up of pixels.


I don't understand what you mean...

I've some Questions for this NEHE Example:

1) Could I do this easier ? :p
2) How can I set the level of AA ?


Sorry for beeing so stupid ...

Dark Photon
09-21-2009, 06:53 PM
Does a normal example use FBO ?
No, normally it renders directly to an on-screen window.


Do you mean with "off scren rendering" that my programm renders object with are not on the screen ??
Renders objects to someplace off-screen, yes.



Why not sample them at more than one location in a pixel, and then blend those samples together. Gives you smoother edges, more like what you'd see if your screen wasn't made up of pixels.

I don't understand what you mean...
See this:
http://www.hothardware.com/articleimages/Item903/luminex_aa.jpg


I've some Questions for this NEHE Example:

2) How can I set the level of AA ?
In the NeHe example, you see the WGL_SAMPLES_ARB, 4 ,? Change the 4 to something else. Which values are available depends on your GPU and GPU driver. See vendor documentation for how to list which modes it supports.


1) Could I do this easier ? :p
Maybe. Depends on your GPU vendor's driver and tools. For instance, on NVidia you can use a settings GUI to nail the AA to one specific mode. You can also set a variable termed __GL_FSAA_MODE to magic numbers to force specific AA modes.

DarkShadow44
09-22-2009, 09:36 AM
Thanks,
but is it normal that FSAA is so slow ??
On the PC of my dad it runs faster...

How can I sync the Programm at 60 fps or something like that ?
It still works better GPU = faster...

And how can I change the level at the runtime ?
I tried it with

int iAttributes[] =
{
WGL_DRAW_TO_WINDOW_ARB,GL_TRUE,
WGL_SUPPORT_OPENGL_ARB,GL_TRUE,
WGL_ACCELERATION_ARB,WGL_FULL_ACCELERATION_ARB,
WGL_COLOR_BITS_ARB,24,
WGL_ALPHA_BITS_ARB,8,
WGL_DEPTH_BITS_ARB,16,
WGL_STENCIL_BITS_ARB,0,
WGL_DOUBLE_BUFFER_ARB,GL_TRUE,
WGL_SAMPLE_BUFFERS_ARB,GL_TRUE,
WGL_SAMPLES_ARB,level,
0,0
};and
void ReWindow()
{
changeS();
DestroyWindowGL (&window); // Destroy The Active Window
if(CreateWindowGL (&window)==false) exit(0); // Was Window Creation Successful?
if(Initialize (&window, &keys)==false) exit(0);
arbMultisampleSupported=false;
}
but it don't work...

And how can I change the resolution(Fullscreen) at the runtime ? (this means better quality, too)


The program aTuner also changes antiAlias, so which AA does that use ???

And how could I find out which values of AA are supported ?
The configure programm of nvidia can't use AA x16, but with aTuner it works...


Can I make my applications run faster, or is my GPU too slow ??

:o I still ask too much questions

Dark Photon
09-22-2009, 04:24 PM
is it normal that FSAA is so slow ??
How can I sync the Programm at 60 fps or something like that ?
And how can I change the level at the runtime ?
And how can I change the resolution(Fullscreen) at the runtime ?
The program aTuner also changes antiAlias, so which AA does that use ???
And how could I find out which values of AA are supported ?
Can I make my applications run faster, or is my GPU too slow ??
You need help from someone that develops on Windows.

And you need to focus on asking precise and informative questions. Read this: How To Ask Questions The Smart Way (http://catb.org/~esr/faqs/smart-questions.html). You don't provide enough data on many of these for folks to even want to touch them.

Your Nvidia GeForce 6200 is an ancient graphics card (now 5 years and 6 generations old), that was slow even for the cards in its generation, with a low memory bandwidth and slow pixel clock. This likely explains some of your performance frustration.

Find a poorly-performing view, shrink your window, and if performance improves, you're likely fill limited. Same thing goes for AA. The higher the AA, the more memory bandwidth you need, and the slower you'll go, if you're memory bandwidth limited.

For Fullscreen, look at the implementation of glutFullScreen() in the FreeGLUT (http://freeglut.sourceforge.net/) library.

zed
09-23-2009, 01:20 AM
as Dark Photon saiz the 6200 is very very slow
how slow?
http://en.wikipedia.org/wiki/Comparison_of_Nvidia_graphics_processing_units

6200, 600MP/sec
9500, 4400MP/sec i.e my card which aint great is 7x as fast
the top of the range are 50x as quick!!!!

i.e. on your card having a small window of 400x300 + no AA is gonna be slower than a top of the range using the resolution 1600x1200@4xAA

DarkShadow44
09-23-2009, 05:42 AM
This Programm don't uses glut:


int screen=2;
#include <stdio.h>
int changeS()
{
char msg[5];

sprintf(msg,"%d",screen);

//MessageBox (HWND_DESKTOP, msg, "Screen", MB_OK );
switch(screen)
{
case 2:
screen=4;
break;

case 4:
screen=8;
break;

case 8:
screen=16;
break;

case 16:
screen=2;
break;
}

return screen;
}


#include <stdio.h>
int s;
void ReWindow()
{
s=changeS();
char m[100];
sprintf(m, "Lesson 46: NeHe & MainRoach's FSAA Tutorial) - AA x %d - %dx%d",s,ww,hh); // Window Title
window.init.title=m;

DestroyWindowGL (&amp;window); // Destroy The Active Window

if(CreateWindowGL (&amp;window)==false) exit(0); // Was Window Creation Successful?
if(Initialize (&amp;window, &amp;keys)==false) exit(0);
arbMultisampleSupported=false;
}

void ReWindow2()
{
changeRes();
char m[100];
sprintf(m, "Lesson 46: NeHe & MainRoach's FSAA Tutorial) - AA x %d - %dx%d",s,ww,hh); // Window Title
window.init.title=m;
window.init.width = ww; // Window Width
window.init.height = hh;
DestroyWindowGL (&amp;window); // Destroy The Active Window

if(CreateWindowGL (&amp;window)==false) exit(0); // Was Window Creation Successful?
if(Initialize (&amp;window, &amp;keys)==false) exit(0);
arbMultisampleSupported=false;
}



void Update (DWORD milliseconds) // Perform Motion Updates Here
{
[...]
// ENDROACH

if(g_keys->keyDown ['X'] == TRUE)
{
ReWindow();
}

if(g_keys->keyDown ['C'] == TRUE)
{
ReWindow2();
}
[...]
}

void Draw (void) // Draw The Scene
{
// ROACH
if(domulti)
[...]
angle=105;
for(float i=-10;i<10;i++)
for(float j=-10;j<10;j++)
{
glPushMatrix();
[...]
}


I want to create an engine that can change FSAA / Resolution at runtime...

What is wrong ?

Resolutions seems to work, but AA doesn't...

And If I disable AA ("domulti=0" or "#define CHECK_FOR_MULTISAMPLE 0") it is still slow...
That's not the sense...

@zed:
Why should the better resolution be faster ??
If I use better AA/resolution it is slower :D

Dark Photon
09-23-2009, 04:48 PM
on your card having a small window of 400x300 + no AA is gonna be slower than a top of the range using the resolution 1600x1200@4xAA
Why should the better resolution be faster ??
If I use better AA/resolution it is slower :D
He was comparing a tiny res with no AA on your GPU to a huge res with AA on a better ("top of the range") GPU, and your card still finishing last because it's so slow.

So use your card to learn OpenGL, but don't expect decent performance from it, especially with higher resolutions and/or AA modes. Where fill rate is concerned, sorry, but it sucks. Time to upgrade!

I'm sure you can do a lot better, but if your budget is tight and you don't have a PCIe motherboard yet (same here), consider a GeForce 8400 GS PCI (not PCIe, PCI!). This puppy will pop into any old motherboard with PCI slots, including old ones with AGP graphics slots. It'll give you over 15X the fill capacity that your 6200 has and it supports OpenGL 3.x!

I bought one of these to work with OpenGL 3 for several months while I save up for a complete system upgrade (and a beefier GPU). If you don't need lots of bus bandwidth to/from the GPU (i.e. no real-time streaming of videos/textures to the GPU), then its a good pick. And it only cost me around $30 several months back.

DarkShadow44
09-25-2009, 04:04 AM
Thanks,
I will see what I can find ^^

And do you know how to disable FSAA ? If I use "domulti=0" or "#define CHECK_FOR_MULTISAMPLE 0" it is still slow..

And how can I hange sesolution/AA at runtime ? my changes don't work...

And if I use a better resolution, do I have to use other models?


As I saif, I want to create an engine, so how can I check which AA / Resolution/... is supportet by the GPU ?


And what is better with OPenGL 3.x ? I read that it isn't better...

Dark Photon
09-25-2009, 10:20 AM
And do you know how to disable FSAA ? If I use "domulti=0" or "#define CHECK_FOR_MULTISAMPLE 0" it is still slow..
And how can I hange sesolution/AA at runtime ? my changes don't work...
And if I use a better resolution, do I have to use other models?
As I saif, I want to create an engine, so how can I check which AA / Resolution/... is supportet by the GPU ?
You need a MSWindows person helping you here.

From this:
* http://www.opengl.org/wiki/Multisampling
to disable AA, you want to use wglGetPixelFormatAttribiv to grab a no-AA (single sample) pixel format and use it to create your window, and then just glDisable( GL_MULTISAMPLE ) (or never even enable it).