Original Post
Hello, I implemented hardware instancing in my 3D engine and I am getting some performance issues. My test scene contains 100 objects and each one has 30k triangles, so in total I am rendering around 3M triangles. Without instancing I am getting 9FPS and with instancing only 8FPS. I have the latest drivers and I tested my application on GeForce 9700GS (Windows XP) and GeForce 8600GS (Windows Vista) and it behaves similar. I have 2 static vertex buffers. First one contains geometry of the mesh and the second one holds instance data (transformation matrix). Buffers are created in managed memory pool (I also tested the problem with default memory pool, but it didn't change anything). Before calling DrawIndexedPrimitive from the device I am running following code: pD3DDevice->SetStreamSourceFreq( 0, D3DSTREAMSOURCE_INDEXEDDATA | a_nNumOfInstances ); pD3DDevice->SetStreamSourceFreq( 1, D3DSTREAMSOURCE_INSTANCEDATA | 1ul ); In my vertex shader I am passing instance data trough NORMAL1-NORMAL4 (I tested also TEXCOORDx, but it didn't help). The problem with the performance appears when I try to access my instance data in the shader - if I don't use it then I am getting around 40 FPS. I think that there must be something wrong with the second vertex buffer which holds instance data, because as soon as I access the data from it the performance drops significantly. Does anyone has a clue what might be wrong? Thanks.