Torque Shader Engine DocumentationCVS Revision Label 0.1.x |
Table of Contents
All of the same guidelines and procedures for contributing to the TSE are the same as for the TGE. See the TGE documentation for that information. Note that there is a separate bug tracker for the TSE.
There are a lot of rendering features that have not been fully ported over from the TGE. Things such as the foliage replicator, the particle engine, various GUI elements, etc. If there is something that you'd like to port over, keep in mind the following:
Static vertex buffers are much faster than dynamic vertex buffers. Obviously if the vertices reside on the card and don't need to be frequently updated that's going to be faster than if they are. Some features such as particles must be dynamic however.
The fewer the state changes the better. In particular, switching shaders, textures, and vertex buffers are slow operations. Try and put everything you want to do in one big vertex buffer rather than lots of small ones. Sort and batch primitives by Material so you only need to draw everything that uses a particular shader/texture once.
Few, large drawPrimitive calls are much better than lots of small ones. You want to have at least 100-200 primitives per draw call if possible. One thing that can be done to increase your batch size is to "link" two sets of geometry by using degenerate triangles. This only applies to triangle strips and fans. If you use triangle lists (less efficient than strips/fans), then you can easily merge just by appending one onto the other.
There is a helper function to create simple primitives called the Primitive Builder. It can be found in gfx/primBuild.h. It uses openGL style functions to translate submitted geometry into vertex buffers.
Go to the developer areas on the nVIDIA and ATI websites for more information on how to effeciently render geometry.