Jump to content
  • Advertisement
Sign in to follow this  
NewtonsBit

Hardware Instancing

This topic is 2501 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

I'm currently losing my mind. I'm trying to render 65536 cubes using a single DrawInstancedPrimitives call. I've set up the excellent example at float4x4 to render 65536 cubes and it does so in about 0.3ms on my machine. Doing the 65,536 cubes in my project, however, currently takes 60.0ms.

As far as I can tell, I'm only doing one thing differently: I'm changing the instance VertexBuffer in the VertexBufferBinding each frame. If I comment out the Draw call, drawing only takes about 4ms. At first I thought it the speed problems were due to changing the buffers, but that's not it. I can draw just the first 256 cubes in the buffer without any performance problems.

Any help? I'm about to start ripping my hair out.

Share this post


Link to post
Share on other sites
Advertisement
To add to the above, my shader is also very simple. The vertex shader multiplies the position and normal by the worldviewprojection matrix and the pixel shader just returns an input color (no calculations).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!