Strange Problem With Rendering Speed...

I ran your test too,

AthlonXP 1800+
Radeon 8500
Win2000

I got 299.75 fps.

wtf… my computer is really strange!
Perhaps something with my AGP port but all my games work perfectly…

V-man -> Thanks.It’s normal that the menu spinns so fast,it’s just because there is no speed limitation in this prog… Every frame,the angle of rotation is increased…
I am glad to read that you like my coding style

PH -> Thank you too,I didn’t test my program on an ATI card.

[This message has been edited by ndj55 (edited 07-25-2002).]

OK, my mistake… I started your project in debug mode and the 3ds files were in the release folder !

I ran the test here and got 564.33 fps (2x Athlon MP 2000+, GF4Ti4200, WinXP Pro).

Looks like your machine is really odd… Have you tried swapping the cards between your 2 computers?

Regards.

Eric

hum…
I think I am going to have a look on my computer and his geforce 2 gts…

Hi,

I’m afraid this is more of a sympathy post. I have exactly the same problem with one of our machines here. None of my OGL apps run very quickly (and it dents my pride <sob> ). So I thought I would test you app on that computer and it performed very badly.

OK my machine (which works fine), dual PIII 550 and GeForce4 ti 4200 and it managed 356fps

However the other machine is a PIII 733 with Geforce 256 and managed a mere 8 (yes 8). I switched it to 32 bit colour and it leapt up to 29.

I wish I had a more productive answer for you but I have not yet got to the root of the problem. I have tried swapping cards around and upgrading drivers but it still has the same problem so I am sure it is either the windows install or the motherboard.

The user of the machine is away today so I shall see if I can find out why it does so badly. The only way I have found of extracting even a half decent performance is by using VAR and even then it has to be in VRAM not AGP memory. Oh yeah, I’ve also ran Quake III on it, and while not superb it was managing about 60fps (my machine manages about 95), but I have no idea how many triangles is typical for a QIII viewport.

Anyway if I find anything I will post them here.

Sounds like you haven’t got any AGP-memory. Check that the bus-type is AGP (not AGP (PCI Mode)) in the control panel (assuming you’re using windows).

Also try some wglAllocateMemoryNV and see if you can get AGP-mem.

Hi

I tested it:

PII 450 TNT2 det 29.42
desktop 1024x768x32 bit : 53fps
desktop 1024x768x16 bit : 8 fps

Maybe the drivers 16 bit code path is not really optimized or you get a crazy pixelformat ?? Or you use different desktop resolutions

Bye
ScottManDeath

Hi,

Give a look at Vertical Sincronization. It must be disable.

Perhaps you are getting a non-accelerated pixel format? I get around 350 fps on my computer with a GF3, but when I rename the OpenGL driver (nvopengl.dll) to force software rendering, I get 16 fps. That’s at least in the same ballpark as 25 fps.

What happens if you add PFD_GENERIC_ACCELERATED on the pfd.dwFlags line? If you get a failure on the GF2 after adding this, it would explain why a non-accelerated format would be chosen. If that’s the case, you’ll then have to figure out why you’re getting a failure. Perhaps the cColorBits needs to be 24 instead of 32?

ndj55, tcobbs was right. You are not always getting an accelerated pixel format. Want to know why? It’s because your pixel format descriptor structure is filled with garbage when you pass it to ChoosePixelFormat. Initialise all structure members to zero and that corrects the problem. i.e. this

PIXELFORMATDESCRIPTOR pfd = { 0 };

ALWAYS, always, always, zero your structures before you do anything with them. Be they Win32, directx, opengl, etc.

Kevin

Originally posted by kevinhoque:
[b]ndj55, tcobbs was right. You are not always getting an accelerated pixel format. Want to know why? It’s because your pixel format descriptor structure is filled with garbage when you pass it to ChoosePixelFormat. Initialise all structure members to zero and that corrects the problem. i.e. this

PIXELFORMATDESCRIPTOR pfd = { 0 };

ALWAYS, always, always, zero your structures before you do anything with them. Be they Win32, directx, opengl, etc.

Kevin[/b]

Not sure that zeroing matters (there is a flags field, right?), but even if you get everything else right, you may still end up without an accelerated format. In some platorms, the Z buffer and the color buffer had to be the same size (16/16 or 32/32). Also on some platforms, pixel formats with 16-bit Z buffers will have no stencil (or a separate software stencil). Put the two together, and you would always fall back to software in 16-bit mode if you ask for a stencil buffer.

Originally posted by kevinhoque:
ALWAYS, always, always, zero your structures before you do anything with them. Be they Win32, directx, opengl, etc.

Not a bad advice but remember that some structures under the Win32 API have one member that indicates the size of the structure: better not set this one to zero…

Now, to get back to ndj55’s problem, it should be easy for him to check whether he gets an accelerated format or not. If he gets one, then I think macke is right: there must be some kind of AGP problem… I am not sure if this can be checked with PowerStrip.

Regards.

Eric

I’ve seen this specific problem occur many times with people worrying about why they were getting mixed rendering results. On some machines rendering was being done in hardware on others software. Every single time it was because their pixel format descriptor structure was filled with garbage. Garbage In -> Garbage Out. ChoosePixelFormat will try to provide a hardware accelerated pixel format, but if you give it undefined parameters (that by their very nature can be anything) then is it any surprise that software rendering frequently occurs?

As to the ‘field flags’. There is a structure member dwFlags. This has nothing to do with whether specific fields in the structure are valid (or not). These flags are general behaviour flags that you would like the pixel format to conform to i.e. PFD_DOUBLEBUFFER, etc.

On the machines where software rendering is occuring, ndj55 in all likelyhood will be asking for stencil buffers and accumulation buffers, etc, even though he did not explicitly specify these - just because his structure is filled with garbage. A fall-back to software rendering is the outcome in most cases.

Kevin

Kevin,

I have had a look at ndj55’s code and the pixel format he’s asking for looks perfectly correct.

I agree with you that in most cases the problem can come from a wrong PIXELFORMATDESCRIPTOR structure but I do not think this is the case here.

As I said in my previous post, it should be easy to check whether the format he gets is accelerated or not !

Regards.

Eric

Eric! Obviously structures should be zeroed before use. They should always then be filled as per API guidelines. Shame on you for trying to score cheap points.

ndj55 is the second person that I’ve spoken to within the last 7 days who had this same problem. ndj55, if you are listening then make the change to your code that I suggested and then give us an update. I’ve already made the change On my machine the framerate jumped from 10Hz to 300Hz.

Kevin

Eric, I hope that it is early morning where you are since your logic is slight awry. You previously reported that you were getting blinding framerates (564.33 fps). Why on earth would you think that you would see things going wrong with the pixel format structure on your machine?

On my more humble machine I originally got 10Hz (generic) but with the code change 300Hz (nvidia). What are you going to say now? That you don’t believe me? Many others before me mentioned that perhaps his problem was related to a non-hardware accelerated pixel format. I am only confiming the obvious. Someone out there (who suffered from low framerates, so not you eric :]) please recompile the code and second this finding.

Kevin

Originally posted by kevinhoque:
Eric! Obviously structures should be zeroed before use. They should always then be filled as per API guidelines. Shame on you for trying to score cheap points.

Kevin,

I am not here to score anything.

Actually, you may very well be right: I thought that ndj55 zeroed his structure before passing it to ChoosePixelFormat. I have just checked again and I was wrong.

To be honest, I DO NOT zero my PIXELFORMATDESCRIPTOR before passing to ChoosePixelFormat because I DO NOT use ChoosePixelFormat (I use a custom function that does not use the same criteria).

Now, let’s see if that fixes the problem.

Regards.

Eric

Originally posted by kevinhoque:
[b]Eric, I hope that it is early morning where you are since your logic is slight awry. You previously reported that you were getting blinding framerates (564.33 fps). Why on earth would you think that you would see things going wrong with the pixel format structure on your machine?

On my more humble machine I originally got 10Hz (generic) but with the code change 300Hz (nvidia). What are you going to say now? That you don’t believe me? Many others before me mentioned that perhaps his problem was related to a non-hardware accelerated pixel format. I am only confiming the obvious. Someone out there (who suffered from low framerates, so not you eric :]) please recompile the code and second this finding.

Kevin [/b]

Kevin,

This is your 6th post on this board and this is the 2nd one that is aggressive towards me. What’s wrong with you?

I know I do not have any problem on my machine but I thought I may find something wrong in THE CODE that ndj55 sent me: I looked at the code, didn’t see anything wrong and then said so. You pointed out that the structures were not zeroed and I said you may well be right.

What more do you want? Why the hell do you show so little respect to other people?

Eric

469.33 @ GeForce 3 / Athlon XP 1800…

p.s. Zickenzack: “Sorry, but that’s bs. There’s a default state for everything in OpenGL. And NVIDIA’s drivers seem to obey the spec quite strictly.”

Well, believing is good, unbelieving is better… if the prog shall run on Intel chipsets anyway .

[This message has been edited by BlackJack (edited 07-29-2002).]

Eric, there’s nothing ‘wrong’ with me. Thanks for asking. :]

If you feel that I was being aggressive towards you then accept my apologies. No aggression was intended…Hence the smiley face in the last post?

Lets find out if the given advice fixes his problem without letting rip with any more ‘Why the hell do you show so little respect to other people?’ That outburst wasn’t exactly designed to endear? :]

P.S. Thanks for admitting that I might be correct. If I’d seen that post previously then perhaps I would have added more smiley faces.

Kevin