   Backface culling
  Hi all !Suppose I have a bunch of triangles which are completely inside the frustum. On average, 50% of them are facing away from the viewever.The question is: when working with D3D, should I remove those invisible triangles, or is D3D supposed to do that for me ?thanks :D!   
D3D does it for you. You can set the backface culling behavior using the appropriate render state:d3ddevice->SetRenderState( D3DRS_CULLMODE , D3DCULL_NONE );   // all faces are renderedd3ddevice->SetRenderState( D3DRS_CULLMODE , D3DCULL_CW );  // all clock-wise faces are culled awayd3ddevice->SetRenderState( D3DRS_CULLMODE , D3DCULL_CCW );  // all counter-clock-wise faces are culled awayYou should try to minimize the per-triangle processing and let D3D do all the work for you, as passing vertex/index data to and from the GPU is not the best habit in terms of performance.   ;  D3D will do it for you. It'll still process the vertex shader for the vertices, but it'll be culled before doing any Z-writing or pixel shaders.It's usually best to let D3D handle this stuff unless there's a lot of back-facing triangles which won't change for a long time (I.e. over a second), since the GPU can do it considerably faster than your app.   ;  Thank you guys !I have an octree structure that quickly cull away all the triangles that are outside the frustum. Then you can have:- triangles that are completely inside the frustum, but may be facing away (you told me to let D3D handle this)- visible triangles that need to be clipped, but even in this case, D3D should address thisA doubt: if one has to minimize the number or vertices passed to the GPU, he SHOULD do some tests to remove triangles, doesn't he ??? A part from occlusion culling and backface culling, there are very few feasible tests avaiable. So what do developers suggest ?   ;Quote:Original post by NiGoeaA doubt: if one has to minimize the number or vertices passed to the GPU, he SHOULD do some tests to remove triangles, doesn't he ??? A part from occlusion culling and backface culling, there are very few feasible tests avaiable. So what do developers suggest ?Don't worry about backface culling, just do rough culling. The exception to that is if your geometry has a lot of vertex data in it (I.e. tens of thousands of vertices), or you have very expensive shaders.PVS' (Potentially Visible Sets) are one way of eliminating a lot of vertices efficiently.   