PStats and my game

I have a PC that runs new source engine games in realtime framerate at high graphical settings.

Though my simple panda game can’t reach 60 fps. In hope that its my fault for doing something stupid, I finally learned to use PStats and trying to find out what is causing the low framerate.
I read the manual page for pstats, but it doesnt explain everything.
So this is why I started this topic.

The manual mentions the main collectors are App, Cull and Draw, but theres also Frame, * and Wait. I dont really understand what they are for based on the subcollector names, but Wait and * seem to be the ones going way up from 60hz:


Of course the other collectors are pretty high too.

According to PStats there are:
64k vertices, 117 nodes, 50 geoms, 61mb graphics memory.
Running on: i5 processor, 4gb ram, 1gb graphics memory.
Any other info I should have posted?

When I look at objects with alpha textures such as grass or trees, the framerate goes even lower, you can see it in the image. I wonder why.

I’m guessing you have video sync enabled (it is enabled by default). With video sync enabled, the frame will wait for the next integer fraction of 60 Hz before drawing, so if your frame rate drops a tiny bit below 60 Hz, it means you will actually achieve 30 Hz. That extra time shows up in “Wait”. (If you double-click on “Wait”, you’ll see more information, and you’ll see that it’s waiting in Wait:Flip, which is where the graphics driver holds up the frame for video sync.)

To disable video sync, put:

sync-video 0

in your Config.prc file. Note that the graphics driver might still override this setting; if that happens to you, you have to disable video sync in your graphics driver settings.

For the record, “Frame” is the total frame time, and “*” is the general overhead category which includes animation time. “Wait” is any time Panda isn’t doing anything, and it includes video sync wait as well as other kinds of waits.

David

I have

sync-video #f

in my prc file.
And shouldnt vsync somehow be disabled if you go below 60?
Anyway, i get variety numbers from 60 to 30, so its probably disabled.

Why would video sync be disabled when you go below 60? The main reason for enabling video sync is to prevent tearing, which happens when you render a frame at the same time the video refreshes. That can happen regardless of your frame rate.

Also, since your reported frame rate is an average over time, it can report values that range between 30 and 60. Even though any one frame is either 30 or 60, an average of many of them could be any number in between. But your PStats graph looks like it’s mostly either 60 or 30, which strongly suggests video sync to me. Also the symptoms you describe strongly suggest video sync.

The proof is to double-click “Wait” and see where all the wait time is spent. If it’s in “Flip”, that’s almost certainly video sync.

David

I dont know, I thought its better than having 30fps if you go a bit below 60 and 15 if you go abit below 30… just a thinking of someone who has no experience.

I have already said how I modified my Config.prc file to disable vsyc, but heres a pic of Wait:

though when i dont look at the grass and trees, i get this:

I get around 75 fps in my options screen and around 200-120 in simple code snippets.

Is it possible that my graphics card re-enables vsync at some point?

Yes it can. Panda 3d can only ask the GPU to be set at around said fps, but the gpu still has the final say on if it’ll do it or not, but I fear that’s not what the issue is here:)

I mean at some point.
The title screen and main menu screen give around 75fps. I wonder if vsync is re-enabled after those.

Another possibility is that there’s something in your grass and trees that’s very fill-heavy, like a really expensive pixel shader. Is that possible?

David

Nope. Just textured with transparent png.
I have mentioned of the poor performance I get with transparent textures before:
panda3d.org/forums/viewtopic … highlight=
of course in actual games where other things are happening the performance loss is more obvious. Also antialiasing has additional effect on this.

Well, you might consider reducing the depth complexity of your grass, then. Don’t have so many polygons stacked on top of each other.

You can avoid some of the cost of transparency by using MBinary instead of MAlpha or MDual.

David

Well, I never had as much as the Nvidia demo

Ill see if theres enough performance gain with MBinary…
EDIT: not really