Panda3D Manual: Performance Issue: Too Many Meshes
<<prev | top | next>> |
If you are having too much nodes/meshes in your scene, this might result in a slow performance. You can check your Geom count in PStats, or by calling `NodePath.analyze()` on your object or scene. Panda3D provides a function to reduce the mesh count: NodePath.flattenStrong(). This will reduce the NodePath to only one node. Be careful with this function: Usage without care might cause your game to crash, since you will not be able to move individual subnodes of a flattened node around anymore. NodePath.flattenMedium() and flattenLight() are not as rigorous NodePath.flattenStrong(), but may be worth considering. Though, if you have multiple independently-moving rigid nodes, the flattening functions might not suit your needs, because, since the flattening functions flatten everything to one node you won't be able to move individual sub-nodes around. An alternative is the Rigid Body Combiner, which can combine multiple nodes while you can still change the transforms on the sub-nodes. If you are using the GeoMipTerrain for terrain rendering, that might also result in a large mesh count. (You can check the block count by calling `terrain.getRoot().analyze()`.) If it is too high, try increasing the block size, or enable AutoFlattening, which will reduce the block count to only one. The autoflatten function was created because normally you can't flatten a terrain using the normal flattenX methods, because this will interfere with the GeoMipTerrain's updating system.
<<prev | top | next>> |