View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Merging meshes

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.

2 replies to this topic

Posted 21 March 2014 - 11:18 AM

I'm asking about this topic because I saw an old post where someone had used a technique to merge the meshes of cubes to reduce draw calls. I've never tried to merge meshes so I don't know how it works exactly.

If I have a vertex buffer for a cube, I can create a chunk and store the chunk into another big vertex buffer. But this doesn't reduce the number of triangles for each cube in the chunk. How would I take the chunk and create two giant trianlges for the side of the chunk?

Is this technique worth using if the cubes will be changing constantly? The initial loading of the chunks will be done at load time, but little changes can be done easily at render time

If you see a post from me, you can safely assume its C# and XNA

### #2Buckeye  GDNet+

Posted 21 March 2014 - 12:16 PM

Not sure what topic you refer to, but, in general, if you have several objects which use the same material or same texture, etc., you store all the vertices for the objects in a single vertex buffer and draw them all with a single DrawPrimitives (e.g.) call. The intent of that method is not necessarily to reduce the number of primitives drawn, just the number of calls.

With regard to "chunks," you'll have to explain what you mean by that.

With regard to constantly changing cubes, it depends on what's changing. If you're not changing the vertices themselves but just rotating, scaling or translating them, you can do that by setting a matrix.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Posted 21 March 2014 - 12:32 PM