Did I do this right?

I did a speed comparison between Panda3D and another game engine, and this is what I found. In Panda I loaded 20 boned models using:

for a in range 20:
H = Actor.Actor(model)

and did the equivalent using the same model in the other engine.

Now in the other engine I could have made it even faster by loading the model once, even with bones, and copying it 20 times. But even loading it from disk 20 times I was literally getting twice the frame rate in the other engine as I was getting in Panda. Also I kept the windowed 800x600 view in Panda and set the other engine to a windowed 800x600 view at 16 bit color depth.

So did I do something wrong in Panda or are these results accurate?

OK, I’d do some tests.

First of all – let’s talk about milliseconds per frame, instead of frame rate. I always find that’s a more sensible way of analyzing things.

So first question - what kind of milliseconds/frame do you get with a completely blank screen with no models? That will tell us overhead.

Second question - what kind of milliseconds/frame do you get if you load the models and display them, but don’t start the animation?

Third question - add the animation.

Fourth question - does this other engine use hardware skinning? Panda can use hardware skinning, but it’s not enabled by default.

How do I find out the milliseconds per frame and what’s hardware skinning? Sorry, I’m a noob. :blush:

About milliseconds per frame:
thats 1 / fps * 1000.
Create a variable called prevTime, and a task.
In that task, compute the milliseconds using:
msec=task.time-self.prevTime * 1000.0
#now you got the milliseconds in ‘msec’ variable, do withit what you want.
self.prevTime=task.time

hth.

Also, don’t forget video sync: I believe Panda turns this on by default, because it’s better for the end-user to have it on, but for raw performance comparisons it’s better to have it off, and this is what many engines do by default. To turn it off in Panda put:

sync-video 0

in your Config.prc.

But for any real performance analysis, you need to fire up PStats and see where the time is being spent. PStats can also easily tell you the time in milliseconds-per-frame, no need to monkey around with tasks.

David

Thanks for the responses.

Update: I did the same thing again (I think) with a different boned model and this time Panda seems to be faster. If I did something different I have no idea what it is.

By the way, is there some way I don’t know about to copy an animated model so I don’t have to load it over and over? Or is that what Actor.Actor actually does?

Yes, that’s what Actor.Actor actually does, since it goes through loader.loadModel(), which copies after the first load. Though if you really want to be explicit with your copies, you can do:

H2 = Actor.Actor(other = H)

David