I’m currently developing my own 3d engine, which has a very limited abilities in terms of geometry rendering and I want to expand it. What I’m interested in is how-it-should be done in terms of storing the geometrical objects and drawing them.
For now my abstraction only supports rendering geometry as generic lists of triangles (D3DPT_TRIANGLELIST in Direct3D terms). There are couple other ways of representing the objects – such as triangle strips (D3DPT_TRIANGLESTRIP) or triangle fans (D3DPT_TRIANGLEFAN).
My question is – are they actually used when drawing geometry in modern 3D engines?
How can their usage benefit and do they somehow fit in the game creation pipeline?
(I mean, like, can artists develop their models so that they’re utilizing these strips/fans techniques?)
TriangleStripare used frequently for terrain rendering or other type of meshes with conjuction of restart strip indices (0xFFFF or 0xFFFFFFFF) or degenerated strips. They offer the best ratio in terms of triangles per indices storage. And if you have good vertex cache optimized meshes, they will totally rule the world.TriangleFanare present in D3D9 but have been removed from D3D10 and D3D11. My advice, avoid using them. The reason they are no good anymore is because they do an awful job as far as attributes interpolation are concerned (such as texcoord or normals), because you can do very thin and elongated triangles with them.You can argue you can do that too with strips or triangle lists, yes of course, but actually the ability to do fans lead to not friendly (artefact wise) meshes. By removing it from D3D, content creation tools will probably output tesselation that avoid lenghty triangles that have acute angles.
Long and thin triangles are also bad (performance wise) because it generates suboptimal quad fragments during rasterization process (see excellent Humus post on triangulation).
Of course this advice apply if you are coding a high performance/ high quality rendering engine, if you are doing hobby code, you want maybe not care of this that much.