Jump to content
  • Advertisement
Sign in to follow this  
raydey

Shimmering artifact when using hardware instancing

This topic is 2335 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,

I've got hardware instancing working in Direct3D 9 with around 500 NPCs moving around, however, I've noticed that when zoomed out there is a sort of shimmering effect as if they're being drawn. Does anyone know the reason why this would be happening?

I am locking and unlocking the (dynamic) vertex buffer that contains the transformation matrices of each instance every frame with the NO_OVERWRITE flag if that makes a difference.

Any help would be much appreciated!

~Ray

Share this post


Link to post
Share on other sites
Advertisement
With NO_OVERWRITE you basically promise not to touch any data that the GPU is still using. This can actually be tricky to pull off, since there can be a long latency between when you issue a draw call and when the GPU finishes processing it. So to be robust you'll need to have a buffer big enough to hold 2-3 frames worth of instance data, or you'll need to have 2-3 different buffers that you swap between.

The other alternative is to use DISCARD, which makes things a lot easier since the driver manages the actually buffer memory transparently behind the scenes. But to do that you'd need to make sure you only lock the buffer once per frame.

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!