Jump to content

  • Log In with Google      Sign In   
  • Create Account

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.


  • You cannot reply to this topic
2 replies to this topic

#1 burnt_casadilla   Members   -  Reputation: 443

Like
0Likes
Like

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 :)


#2 Buckeye   GDNet+   -  Reputation: 10734

Like
0Likes
Like

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.


#3 burnt_casadilla   Members   -  Reputation: 443

Like
0Likes
Like

Posted 21 March 2014 - 12:32 PM

http://www.gamedev.net/topic/569123-need-advice-on-drawing-large-amounts-of-voxelscubes/

The cubes he draws only use two triangles when they use the same texture/color. All mine will be the same color so that's not an issue

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





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