Jump to content
  • Advertisement
Sign in to follow this  
zalthar

Rendering and Draw primitive calls

This topic is 4847 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

I have read in a lot of articles that you should try to keep the number of drawprimitive calls down to a minimum. Well its obvious that you can batch all calls together that uses the same texture and effects. But say if you where to draw 10000 objects of the same type(same texture and effects). Don't know if it is likely to happen but anyway. Since all these 10000 objects have different locations they will be using different world matrices. Is it still possible to batch them together in some way? /Zalthar

Share this post


Link to post
Share on other sites
Advertisement
There is a technique called "instancing" where you feed the basic geometry in one vertex stream and the per-instance data in another. Then you set the second stream's frequency divider so as to tell the hardware how often the per-instance data is to be used.

This technique requires quite recent hardware to work, though. You could also use a vertex shader with weighting values encoded in the geometry to emulate true instancing, but it is not as flexible nor efficient as the first method I suggested.

Share this post


Link to post
Share on other sites
if none of the 10000 objects moves you could also transform them into world space at load time and pack them together into one batch, since they would use the identity as world matrix then ;)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!