Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Most efficient method to render a bunch of cubes?


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
3 replies to this topic

#1 coder13   Members   -  Reputation: 100

Like
0Likes
Like

Posted 20 April 2012 - 09:11 AM

Hello, I have been troubled by this for quite a bit. I understand some basics to rendering a cube. So I would just put it in a class, then come render time, just translate it depending on its location. I was wondering if this is the most efficient way to to render a bunch of cubes?

Sponsor:

#2 FLeBlanc   Crossbones+   -  Reputation: 3117

Like
-1Likes
Like

Posted 20 April 2012 - 09:59 AM

No, it's not the best way. In fact, that will be extremely slow. You want to reduce your total number of draw calls. Drawing each cube individually results in a LOT of draw calls. You want to cull the non-visible cubes so that they are not drawn at all, cull the non-visible faces, and batch up the visible faces into as few draw calls as you can manage. You might want to check out this series of articles by a guy named Michael Goodfellow, written as he worked his way through this same thing.

#3 Tournicoti   Prime Members   -  Reputation: 684

Like
0Likes
Like

Posted 20 April 2012 - 11:11 AM

Hello coder
Maybe could you be interested by geometry instancing ?
This way, you provide the mesh of the cube (only once) and the world matrices of all the instances (and eventually other data you need for rendering each instance).
With this technique all the cube instances would be rendered within a single draw call.

Sorry I can't be more specific, I only use DirectX10 Posted Image , but I'm sure you'll find easily some documentation on OpenGL instancing Posted Image
Bye

#4 coder13   Members   -  Reputation: 100

Like
0Likes
Like

Posted 20 April 2012 - 12:36 PM

Thank you for your replies. I will look into them.




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