Frame Per Second

Hi,

Simple question:

Can someone give me the code to see the frame rate?
I’m sure I see this code somewhere around.

I’m searching for this in the documentation and in the forum but can’t find anything (I pass one hour looking at the forum…). I think I “know” how to do one myself but I’m not sure it will be accurate.

Thanks a lot

Jaff

some options :

  1. edit your .prc file :
show-frame-rate-meter 1
  1. to change the visibility status at the beginning, do this before importing DirectStart :
loadPrcFileData('','''
show-frame-rate-meter 1
''')
  1. anywhere in the code :
base.setFrameRateMeter(status)
  1. in a task:
if(task.dt>0.0): print 1.0/task.dt

Ok first thing I tried was the task. But I received something like that:

7769.3693307
703.786457314
7366.53593441
5476.21541586
7608.9312054
5118.64761917
7575.68569389
4805.71550174
7640.40740736
4937.95908034
4661.07802327
4704.01134405
7614.68361606
5247.94202449
7535.44288783
4898.52954591
7607.79554527
4699.34862387

I don’t think that this can be frame rate hehehe :laughing: After that, I tried to change the config file, but it does not change anything… I also tried to change other things in the config file but it’s like panda do not care about these change…

I think Panda is not looking at my Config.prc file because I change the fullscreen and all of this and nothing changed… Do you have an idea what can make this?

Thanks!

Jaff

Those might actually be your frame rates if you’re not rendering anything.

You’re probably editing the wrong Config.prc file. Try this:

print ConfigPageManager.getGlobalPtr()

This will print out the list of Config.prc files that Panda has read. Make sure the one you are editing is on that list.

David

Oh thanks for the info.:slight_smile:

I did it, and it shows me config.prc in the Panda3d.1-3-2 but i’m currently using panda3d.1-4-2. I was editing the wrong file. So, if I delete my old installation of panda3d, will it be ok? Or is there a cool command line to tell panda to use config from version 1-4-2??

Jaff

Hmm, I wonder if you are really using Panda3D 1.4.2, or if you only think you are?

print PandaSystem.getVersionString()

It’s supposed to use the right Config.prc automatically according to the version of libdtool.dll that it loads.

In any case, it might be prudent to delete old versions of Panda anyway, just to ensure nothing is getting in there accidentally.

David

Thanks,

That was the problem. It was using 1.3.2 hehe. Are you aware of any problem with the sound in 1.4.2? Because everything was ok in version 1.3.2 but now there are pop and crack all the time :frowning:

When I used packpanda to make the .exe with the bin from 1.4.2 I had the same problem so it’s directly related to 1.4.2.

Any idea?

Thanks again

Jaff

If I’m not mistaken, the default audio library changed from FMod to OpenAL recently; that might have been in the switch to 1.4. You can change it back by editing your Config.prc file.

David