×
Menu

Triangle/TriShape Ratios and Clipping/Culling Behavior

 
Касается темы продуктивности кол-во треугольников в объектах.
Имеет отношение не только к видимым сеткам, но и к просчету взаимопересечений оных.
Хотя, конечно, полезно учитывать эти данные и при создании новых моделей.
 

Это выдержка из Maximmerse.chm файла(С)
 
How to Reconcile Triangle/TriShape Ratios and Clipping/Culling Behavior
These two issues, triangle/NiTriShape ratio and the culling/clipping behavior, place somewhat contradictory demands on you. To improve the triangle/NiTriShape ratio you must have the most triangles in a NiTriShape possible (mesh collapsing, increasing the number of triangles in the mesh, etc.). Simultaneously, the NiTriShapes must be kept compact to allow efficient culling. There is no simple solution to this problem and you must constantly balance the two constraints. In general, triangles should be grouped into NiTriShapes so that culling will still be effective but the NiTriShapes contain the most triangles possible. For example, when modeling the four walls of a room, if the walls are relatively complex (i.e. more than 20 triangles) each wall should be in its own NiTriShape. Having all the walls in a single NiTriShape would improve the triangle/NiTriShape ratio but would force clipping on all the geometry. By dividing the walls into four NiTriShapes, two of them will usually be culled leaving the other two to be clipped. However, if the walls were very simple (i.e. 2 triangles each) then it might make sense to clump all the wall triangles together to avoid having several 2 triangle NiTriShapes.
One useful trick to see if a poor triangle/NiTriShape ratio is slowing performance is to (in Max) collapse all the geometry in question into one Mesh. For this to be meaningful all the geometry must be on screen at one time (i.e. the effect of clipping vs. culling must be eliminated, since the collapse could result in more clipping). Additionally, all the geometry (both before and after the collapse) should be assigned the same material. This will eliminate the effect of shading changes wrought by the collapse. Once these two criteria are met, the frames per second before and after the collapse can be compared to roughly determine how much performance is being lost to a low triangle/NiTriShape ratio.

Выдержка из оригинальной справки. (NDL Gamebryo 1.1)(С)
В целях общего ознакомления с вопросом (С).

The Triangle / TriShape Ratio
 
The triangle to NiTriShape ratio is the most important geometric metric for game performance. The issue with triangles and NiTriShapes is that when rendering an NiTriShape, Gamebryo must do a fixed amount of work on the CPU (property-state setup, texture swapping, etc.) each time it passes down the set of triangles, no matter how big. You should, thus, try to pack as many triangles as possible into each NiTriShape.
In general, a game should never have fewer than 20 triangles per NiTriShape. You don't have to increase the number of triangles just to improve the triangle/NiTriShape ratio, but if doing so will improve vertex lighting or some geometric detail, it won't hurt the performance. Another way to tackle improving the ratio is to collapse similar meshes with the same materials that are close together in a scene. This collapsed mesh will be converted to a single NiTriShape instead of several separate NiTriShapes, thus improving the overall ratio.
The importance of a large triangle/NiTriShape ratio (i.e. a lot of triangles per NiTriShape) is increased on hardware transform and lighting cards (high-end graphics cards). Hardware transform and lighting cards perform vertex transformation, lighting, and rasterization on the graphics card. Earlier cards could only perform the rasterization while the CPU was forced to do the vertex transformation and lighting.
Hardware transform and lighting cards both free the CPU of this task and perform it faster than the CPU ever could. This division of labor decreases the time required to render an individual polygon but leaves the fixed amount of work that Gamebryo must do for each NiTriShape (discussed earlier) unchanged. In a low triangle/NiTriShape situation the CPU will become the bottleneck (doing the NiTriShape setup) and the full rendering capabilities of the graphics card will not be used. In contrast, a high triangle/NiTriShape ratio will allow the graphics card to draw as many polygons as possible and leave the CPU free to perform other operations.
 
Performance Metrics (не забудьте сделать поправку на мощности "современных" ГПУ)
Performance analysis done at nVidia and ATI revealed that on a 1 GHz CPU, you can render 25,000 objects per second before you spend all of your time on the CPU. This is the case you wish to avoid at all costs. What does this mean to an artist?
You can only render 416 objects per frame on a 1GHz CPU before performance severely degrades! Make EVERY object count!
 
As the CPU speed goes up, the amount of objects rendered per frame will correspondingly go up.
The following sections will discuss how art content issues could increase or decrease the Triangle / TriShape ratio.