Jump to content

  • Log In with Google      Sign In   
  • Create Account

Best way to render a lot of slightly different objects?


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

#1 AvengerDr   Members   -  Reputation: 726

Like
0Likes
Like

Posted 28 January 2013 - 07:57 AM

Hi,

I am building an information visualization system similar to a 3D treemap (i.e.: using stacked boxes to represent the proportional size of nodes in a tree). So basically I need to render a lot of 3D boxes. What techniques can I use to improve performance, beside occlusion culling?


Right now, being a prototype, I'm using a very brute force approach: every object has its own VB/IB etc. So when I have to render several hundreds of them, things begin to slow down. I was thinking about having only one VB/IB and just modify the translation and scaling matrices (to obtain different sizes). Is there any other better way?


--Avengers UTD Chronicles - My game development blog

Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7513

Like
2Likes
Like

Posted 28 January 2013 - 08:07 AM

What techniques can I use to improve performance, beside occlusion culling?

Instancing is the way to go. There are several techniques available, here's an article to get a basic understanding of instancing and different techniques to archieve it (the article is ~7 years old, using modern API like DX11 will ease instancing a lot).


Edited by Ashaman73, 28 January 2013 - 08:11 AM.


#3 swiftcoder   Senior Moderators   -  Reputation: 9997

Like
0Likes
Like

Posted 28 January 2013 - 12:55 PM

I was thinking about having only one VB/IB and just modify the translation and scaling matrices (to obtain different sizes).

That is definitely the first step you should take. Rendering all from one vertex/index buffer is going to be faster than switching buffers for each object.

 

After that, you should be in good shape to tackle instancing, which should be ideally suited to your use-case.


Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#4 cozzie   Members   -  Reputation: 1613

Like
0Likes
Like

Posted 28 January 2013 - 03:31 PM

I agree, a few pointers:

- create separate classes for mesh and meshinstance
- keep track of all properties per instance, rotation, translation, scale, material maybe
- make an index and render by material and then by mesh

Ealrly rejections of meshes you wont't draw is always best and reduces state and buffer changes

#5 kauna   Crossbones+   -  Reputation: 2514

Like
0Likes
Like

Posted 29 January 2013 - 07:59 AM

You may also make some per-instance parameters affect the material. If the differences between the boxes are small (such as diffuse color changes), you may have a diffuse color as a instance parameter. If you are able to use texture array, it is possible to have per-instance index to the texture array slice so you can actually have a lots of variation for each instance.

 

Cheers!






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