x


Combining spatially separate meshes?

Let's say I have a scene with 100 green marbles and 100 red marbles. Would it make any sense to combine all the green into a single mesh and all the red into a single mesh?

First, does it make sense, and second, is there some simple way of say:

loop over marbles:
  We've got another green-marble
  Add it to the existing green-marble mega-mesh.

The marbles aren't going to be moving around independently. If they move it will be as an assembly anyhow (i.e. move all green marbles to the right by 10).

more ▼

asked Jul 02 '10 at 01:51 PM

pickledzebra gravatar image

pickledzebra
286 31 35 44

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

It might make sense. You can set up something pretty easy with Mesh.CombineMeshes.

I suspect that if you combine meshes every frame, though (to update individual rotation/positions of the marbles), it'll be slower than having 200 draw calls. You'll really have to just try it and compare performance numbers on your target min-spec machine.

more ▼

answered Jul 02 '10 at 02:59 PM

Tetrad gravatar image

Tetrad
7.2k 27 37 89

(comments are locked)
10|3000 characters needed characters left

Unity 3's batching should solve this for you if the vertex count of the marbles isn't too high.

more ▼

answered Jul 02 '10 at 10:16 PM

Jessy gravatar image

Jessy
15.6k 72 95 196

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1357
x96

asked: Jul 02 '10 at 01:51 PM

Seen: 1215 times

Last Updated: Jul 02 '10 at 01:51 PM