I'm working on a project where there are 64 textured rocks that react according to simple webcam based motion detection and VERY simple physics and after much brainstorming and rewriting i'm down to 133ms per frame. Which is not good enough.
The things that seems to take up the most time are the script(~55ms) and the TopToCHOPs(~50ms).
The script handles the physics and detected-motion resolution.
The TopToCHOPs determine if a rock has been "touched" and if so from where and how hard.
There are 3 TopToCHOPS per rock (192 in total).
I've read the article on optimization ( http://www.derivative.ca/wiki/index.php?title=Optimize
) and have moved the postitional translations and rotations into the Geometry as SOPs. I've also examined the network for unnecessary cooks.
Some experimentation has show that script-writes to tables take less time than to Geometry COMPs so all of the rock data is stored in a table and the Transform SOP accesses the table for it's data.
I'm wondering if there are any optimization pointers in the scripting part and if there is a way to speed up the TopToCHOPs.
Thank you very much.