Search code examples
shadertriangle-count

Triangle count for model is doubled during render


I am working with the Trinigy 3d engine, and it reports models to have twice as many triangles during render than it does in the model display (let's say 4000 instead of 2000). If I render the model with an additional outline shader, it reports 6000 triangles, so it's not a simple duplication. What could be the problem?


Solution

  • Additional shader passes (like your outline shader) typically increase the number of triangles rendered for a model, since it has to be rendered multiple times. If you are using forward rendering mode, each dynamic light source will also increase the number of triangles rendered, since every dynamic light affecting a model requires it to be re-rendered.

    You can avoid this by either using the deferred shading solution of the engine, or collapsing multiple shaders into a single pass.