Max Polycount

If I’m shooting for at least 30 fps, how many polys do you think panda will render?

Short answer: near-infinite.
Long answer: panda3d.org/manual/index.php/Performance_Tuning
Please read the upper section.

you can try the jungle-engine https://discourse.panda3d.org/viewtopic.php?t=2648. (0.8.1 being the newest one)

comment the interactiveConsole in main.py (add the # to the following lines)

class mainClass( DirectObject ):
  def __init__( self ):
    # create the interactive console
#    from src.interactiveConsole.interactiveConsole import pandaConsole, INPUT_CONSOLE, INPUT_GUI, OUTPUT_PYTHON, OUTPUT_IRC
#    self.pandaConsole = pandaConsole( INPUT_GUI|OUTPUT_IRC|OUTPUT_PYTHON, locals() ) # INPUT_CONSOLE makes komodo ide blocking
#    self.pandaConsole.toggle()

run the script from a console / commandline
and press f5
you will get a output on the commandline:

696 total nodes (including 0 instances); 70 LODNodes.
18 transforms; 27% of nodes have some render attribute.
864 Geoms, with 441 GeomVertexDatas and 4 GeomVertexFormats, appear on 322 GeomNodes.
485917 vertices, 477725 normals, 8192 colors, 475698 texture coordinates.
GeomVertexData arrays occupy 15146K memory.
GeomPrimitive arrays occupy 1762K memory.
8152 vertices are unreferenced by any GeomPrimitives.
488 GeomVertexArrayDatas are redundant, wasting 86K.
683 GeomPrimitive arrays are redundant, wasting 1497K.
317068 triangles:
  75446 of these are on 26827 tristrips (2.81232 average tris per strip).
  241622 of these are independent triangles.
20 lines, 0 points.
11 textures, estimated minimum 7344K texture memory required.

I get around 30-40fps on those 317k triangles on a macbook pro with a ati RadeonX1600 with 256mb ram.

As with any game you play, panda depends on the hardware you have. this jungle-demo can have only 5fps on a bad graphics card or 100 on a very good one (just guessing).

Another important thing is that with bad coding you will get 10fps with 100k tri’s, with good you may get 100fps with the same amount of tri’s. (not only coding but also how you use panda3d)

The polycount itself doesn’t do much to the fps. It strongly depends on lighting, pixel shaders, vertex shaders, texturing, etc. Those are usually the bottlenecks, not the polycount itself.

pro, don’t forget batches (individual polygon geoms) more then 350 and your FPS takes a dip.
This is also a good source:
http.developer.nvidia.com/GPUGem … _ch28.html

also the size of your polygons matters a lot.
rendering 1 polygon which covers the entire screen takes a lot more time than rendering one that only makes up a few pixels of your screen.
my old geforce4 was able to render more than 500.000 triangles while maintaining a good framerate ( 4 terrains above each other each covering the entire screen). if you zoomed away framerate increased several times. if you got close it dropped down to a few frames per second.

like treeform and pro mentioned there are others, by far more important things which limit the fps.

it’s always a good idea to build a “typical” scene of your game and check how it performs, then start optimizing it. pstats is a great tool for pointing out bottlenecks. also the linked quides are quite usefull. and you can always ask here on the forum if you have a questions:)

I also noticed that when large polygons appear on the screen it dramatically slows Panda down (I mean, slows down by few times, not some percent). David, can you, please, explain, is it normal? What to do about it?

There’s nothing in Panda itself that’s inherently slow about large polygons. Whether they’re slow in practice or not depends largely on your graphics card, and also on the complexity of the pixel shaders you have applied to said polygons. For instance, if you are using per-pixel lighting, a large polygon will be much more expensive than if you are not.

What to do about it? Lots of choices.

(1) Don’t put large polygons in front of the camera.

(2) Simplify your shaders, or don’t use per-pixel lighting. Don’t use transparency either.

(3) Try rendering front-to-back, with something like:

cull-bin opaque 20 front-to-back

in your Config.prc file. It might help a little.

(4) Upgrade your graphics card.

David

Well, Im running Vista, intel core 2 cpu, 6400 @ 2.13ghz. its got 2 gigs of memory, and it crashes whenever I try to load in more that 30,000 polys. (that is in one sphere) Any idea about this?

There was a bug with older versions of Panda that would crash when more than about 30,000 polygons were loaded in a single mesh. Should be fixed in the 1.5.x branch though. What version are you running?

(30,000 polygons is a lot for a single sphere, of course. I assume you’re just trying to run a stress test to see what your graphics card can do.)

David

1.5.2 is the version I’m running. Yea I just wanted to test out the engine. I wish there were more examples and tutorials, because I’ve gone through most of the reference section, and now I need to know more.

Have you seen the samples/ subdirectory in your Panda3D distribution?
panda3d.org/manual/index.php/Sampl … stribution

Yea Ive been through all of them, but it seems like they aren’t commented in a way that is really helpful. Like right now, I’m trying to get the models showing inside the class structure, but nothing is showing up. Take a quick look if you don’t mind.

from direct.showbase import DirectObject
import direct.directbase.DirectStart

class Hello(DirectObject.DirectObject):
    def __init__(self):
        self.accept('mouse1',self.printHello)
        self.accept('mouse2',self.ShowBox)
        self.box = loader.loadModel("brick3")
    def printHello(self):
        print 'Hello!'
    def ShowBox(self):
        print 'showing box'
        self.box.setPos(0,30,0)
        self.box.reparentTo(render)
h = Hello()
run()

so that creates a box 30 units in front of the starting position of the camera when right clicking?

should, but it does not!

did you pview brick3.egg ?

yep…It’s ok I retyped it in, and it worked. lol