meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
user-render-configuration [2022/08/18 13:27]
king
user-render-configuration [2023/04/04 09:59] (current)
steph.jorgensen
Line 1: Line 1:
-====== User Render Configuration ======+====== User render configuration ======
  
 The SpeedTree SDK can be configured to have N render passes, each one defined by a name string. In the reference application, we define Forward, Depth Only (shadow casting), and Deferred in ''MyRenderPassNames.h''. These names are passed in an array to each model object in the SDK via a call to ''pModel->SetRenderPasses().'' This is demonstrated in ''CMyPopulate::InitBaseTreeGraphics()'' in ''MyPopulate.cpp''. Right after this code, there is a function call to establish a render config callback for each model (the reference application uses the same callback for all models). The callback is invoked several times for each model, each time with a different configuration to allow the developers to set as many or as few state changes as they need. For example, it’s possible to use only two render configurations for the entire forest: one for 3D tree and grass models, another for the billboard models. Alternatively, it’s possible to establish a different render state/shader for each LOD and each geometry type within each LOD. The former will generate fewer draw calls/state changes and the latter more (but with potentially less general and shorter shaders). The SpeedTree SDK can be configured to have N render passes, each one defined by a name string. In the reference application, we define Forward, Depth Only (shadow casting), and Deferred in ''MyRenderPassNames.h''. These names are passed in an array to each model object in the SDK via a call to ''pModel->SetRenderPasses().'' This is demonstrated in ''CMyPopulate::InitBaseTreeGraphics()'' in ''MyPopulate.cpp''. Right after this code, there is a function call to establish a render config callback for each model (the reference application uses the same callback for all models). The callback is invoked several times for each model, each time with a different configuration to allow the developers to set as many or as few state changes as they need. For example, it’s possible to use only two render configurations for the entire forest: one for 3D tree and grass models, another for the billboard models. Alternatively, it’s possible to establish a different render state/shader for each LOD and each geometry type within each LOD. The former will generate fewer draw calls/state changes and the latter more (but with potentially less general and shorter shaders).