The Curse of the Polygon
The number of polygons in a 3D model was a main concern for us when we started off the development for Garshasp. After a little experience and testing with our rendering engine, OGRE, it was apparent that the number of polygons wasn’t as critical as we thought and other factors such as rendering batch counts had more effects on draining the frame rate. In the second wave of our development, we relaxed the polygon counts a little bit and aimed at higher polygon art.
This trend continued until very recently when yzt, our Director of Tools and Technology, profiled the system using Intel VTune and surprisingly found out that currently one main bottleneck for system performance is the skinning calculations done for animating the 3D characters.
We are currently using software skinning which means all the calculations are happening on the CPU. Every added polygon for a model means added vertices and this would mean that a new computation has to be made on the frame to calculate its correct position using the character skeleton bone positions. The more polygons would mean more calculations per frame.
This bottleneck would be another reason to select lower polygon models but before doing so we tried out hardware skinning in which the calculations for vertex positions are handled in a vertex shader. Embracing the massive parallel architecture of the GPU, these calculations can be handled very efficiently and the initial tests by yzt so far proved to be successful. We need to delve into it a bit more and our next challenge would be to limit the number of bones in character skeletons to comply with vertex shader limitations.
We’ll re-enter the loop to attack the next performance eater after this issue is solved.