   What is "Hardware Instancing"?
  Can someone please tell me what it is (something done in the shader?), and where there might be a tutorial or book that covers the concept?Thanks.   
Duxelle;  Thanks, but all that says is that it is done in the shader.  Any idea where I can learn how?;  Hardware instancing is not done with shader constants, that is called shader instancing.  The dx sdk instancing sample is a good place to learn about it, and see it compared to other instancing methods.   ;  Hardware instancing is described in the DirectX SDK documentation. Other forms of instancing are additionally described in a chapter of GPU Gems.   ;  Thanks.  I found it.  Apparently my ATI X800 XT does not support VS_3_0, but this looks like a good sample for showing the various methods.;  I've heard that ATI cards since the 9600 support hardware instancing even though they are not VS3.0 cards, through a driver workaround.  Check the ATI site for how to do it if you're interested.   ;  ATI cards since 9500 (at least PRO) support hardware instancing. The little problem is how to detect instancing since there is no D3D caps for it. There is a kind of hackish way to detect the support, but I don't have the link here now. At some cases Geometry Instancing needs to be enabled from the ATI control panel.Practically, if you have some geometry instancing sample and it refuses to work because of lacking support for SM3 ... just disable the SM3 checking and it should work (on ATI card >=9500)[edit]found the discussion how to detect hardware instancing support:http://www.gamedev.net/community/forums/topic.asp?topic_id=332289[Edited by - Demus79 on June 5, 2006 3:39:10 AM];  Well, first let me plug my sample on instancing in Managed DirectX. I've made some effort to give a quick overview of the technique on that page and provide sample implementations of both hardware and shader instancing. ATI instancing can also be enabled through a little DirectX hack, described in the articles referenced from that page.The way hardware instancing basically works is that you set up the geometry and the instancing data on two seperate vertex streams. By calling SetStreamSourceFrequency with the appropriate parameters you can let you adapter know which stream contains the geometry and which stream contains the instancing data, such as position, color and/or rotation. You'll also need to set the appropriate stride size when calling SetStreamSource, otherwise you'll get unexpected or no results at all.When these flags are set, the driver/hardware will 'replicate' the geometry data for each instance data element. If you pass in 100 Vector4 elements as instance translation data for example, the vertex shader will be executed on each vertex in the geometry data for each of the 100 translation data elements. You can think of this conceptually as a nested loop:[source lang=c#]foreach(Vector4 translation in instanceDataStream){  foreach(Vertex v in geometryDataStream)  {ExecuteVertexShader(translation, v);  }}Implementation-wise, you'll use a VertexDeclaration to get this data to the vertex shader. In the shader input struct, you'll typically specify the normal geometry vertex elements you want to use, as well as the instancing data elements coming from another stream. Hardware instancing will then take care of the rest and make sure the instance data is set correctly for each vertex, so you can just use it on a per-instance basis without further worry.Hope this makes sense :)   ;  Please correct me if I am wrong because I'm new to D3D.What I've heard is just the opposite of what you say: RD3xx (and maybe even RD4xx) does NOT really support istancing on the hardware level but does it on driver level.The given speedup is simply because the driver still has more work to do before rolling back to application again, this saves CPU time and Batch count at application level. Once inside the driver, batching is much less costly (like GL batching) so the problem is greatly reduced.I read this on NV papers at a GDC so maybe they're stretching it a bit.