How Panda handles NURBS?

I’ll preface this by saying I don’t know a great deal about modeling.

The modeler/animator for the game I’m working on for a class project made some really neat models to use within the game in Maya 7. He constructed them in Maya 7 using NURBS. When I converted them over to egg files and loaded them into the game the framerate plummeted to 8-10 FPS. Viewing Eve in pview I can sustain > 650 FPS.

I booted up Maya, and converted the model over to polygons, and there were astronomical numbers of polygons. I used Maya’s polygon reduction and was able to bring the polys down to a reasonable level.

What I’m wanting to know is if we have to go through this process for every model. Surely there is some way that panda can handle NURBS well? Is there a better way to handle this? Currently I have the actor parented to a node which is parented to render. Do all modelers convert their models to polygons and reduce them before exporting to egg?

Thanks!
-Ryan

In a nutshell: yes. Panda can render NURBS directly, but it’s far from optimal; you’d really much rather render polygons. This is true of almost any 3-D graphics engine. (One day, we hope to make Panda’s NURBS rendering better than it currently is. But even then, it will probably be faster to render polygons.)

But there are tools to convert your models automatically. One easy thing to do is to use the -p option to maya2egg, which automatically invokes Maya’s tools to convert to model to polygon as it converts it to egg. If it makes too many polygons, you can also specify -ptol to reduce the number (larger values of -ptol will produce fewer polygons). I don’t know whether these options are available on the MayaEgg plugin or not.

Another option is to use the program egg-qtess to triangulate your models after you have converted them from Maya. egg-qtess has a “tesselation for dummies” mode, where you just specify the number of triangles you’d like to have in the result, e.g.:


egg-qtess -o polygon-model.egg -t 10000 nurbs-model.egg

There are also other options to egg-qtess to fine-tune the process a lot more than that, for instance in order to add more polygons to an avatar’s face than to his toes. Once you have built a qtess parameter file for a particular model, it’s easy to re-run egg-qtess on that model the next time you have changes to the model. You can also easily generate two or three different levels of polygon density, for creating multiple levels of detail of a given model.

Finally, you can build a script or a Makefile to do all of this more-or-less automatically: once you have set up the script, you just update the Maya file(s) and re-run the script, and out comes your converted polygon files, exactly as requested. At Disney, we use ppremake to generate a series of Makefiles automatically that re-converts the model tree as we specify. These ppremake scripts are also available to you, but there is a bit of a learning curve involved.

David