Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Shimmering artifact when using hardware instancing


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 raydey   Members   -  Reputation: 143

Like
0Likes
Like

Posted 18 July 2012 - 05:03 PM

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

Ad:

#2 MJP   Moderators   -  Reputation: 5416

Like
1Likes
Like

Posted 18 July 2012 - 07:12 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS