[Dynamic meshes] A few questions

Hello there :slight_smile:

Currently in the process of developping a game with customizable avatars, I was wondering if Unity for iPhone would be able to do a few tricks :

  • is it possible to dynamically create a skinnable unified mesh, if I have some multiple different parts ? Ex : got separate body, head, t-shirt and trousers, and I want to be able to assemble them ingame in a unified mesh, and then animate the whole thing with a precalculated bone system
  • is it possible to dynamically create vertex groups in a mesh, and assign bones anims to them ? If yes, how precise selection is ? (sphere zone ? Surrounds of a single vertex ? Manual naming selection ?)

That’s it, I’m searching for ingame dynamic mesh construction for high customizable options :slight_smile:

Is Unity iPhone THIS powerful ?

Thank you for your precious attention, and congratulations for your great work. I hope it will become a real big standard.

everyone is using precalc meshes ? :roll:

no customization at all ?

it might be more likely because the general optimization techniques are explained.

→ less than 30 drawcalls, so a dynamic mesh with multiple materials sound like a good way to kill the performance

→ occlusion culling, which might have more than only little problems with dynamic meshes

→ CPU performance, the iphone is not really fast, we are talking of 1999 class hardware here. Calculating distances and alike for whole meshes? No chance, at least if it was meant to be in realtime. You can already be happy if it works with static models in realtime (perhaps at 300-400 polygons)

Thank you for your attention dreamora :wink:

Well I was talking about pre-generation, like on a loading screen or so, writin generated meshes in a file or memory, I don’t think that would cost more performance than a pre-calc mesh under a 3D software.

This won’t change anything about DCs or material, as the same optimization process would be used as if they were imported from an OBJ file :slight_smile:

And finally, the game would only place 2 characters, with no 3D background, so the number of polys allowed per char would raise dramatically, I guess.

Then yes, I did not find anything like this mesh generation under those forums, sorry.

Cheers !

by a factor of 2 - 3 at best (about 1500 to 2000 animated polys at max with a “common mobile” amount of bones)

question is more to what degree you have the possibility to create bone assignements etc.

and the loading times could raise drastically, with raising exponentially for more vertices and more bones
That is actually the one and only thing you won’t find mobile users to accept obviously as the “hit, play and go” will not work if it is “hit, wait, wait, wait, don’t play and go”

For sure, I do agree with that hit-and-play ToDo.

But if the game offers enough quality in visuals, gameplay and customization, I do believe players would accept to wait an average 3 seconds before a fight (yes, that’s a fighting game).

Furthermore, those loading times won’t pop all the time, only if the player is fighting a new player online (that he wouldn’t have fought before in his game session).

Any other case, like fighting CPU, or the same online player several times in a row, there wouldn’t be loading time at all.

Ok I bought my Unity license,
And well, if there’s no native mesh generation scripts, I’ll find a way to make mine :slight_smile:

Something like playin with connecting vertices between sub meshes, I guess.

Let’s go !

slides sleeves up

Id like to be able to do this as well n0mad

What an old thread ^^

Now Unity integrates a native function for that CombineMeshes()
Look at the docs.

The static combiner function is Pro only though (and iOS Pro only) as static batching is

Generating meshes, bones, weightmaps, and assigning animation at run time is completely possible.

take a look at the example code in the docs under Mesh.boneWeights

Although ComineInstance class works very well for that purpose, it still has a missing feature : it doesn’t combine bindposes.
Result is that if some bones are shared amongst multiple combined objects, they will be added as many times as the combiner see them (that is, a Torso boneWeight will be multiplied by 3 on the combined object if it is shared between arms, body and head).

I made a thread for that here : http://forum.unity3d.com/threads/63336-CombineInstance.combine()-misses-one-last-feature

Andeeee suggested to report it as a bug, but I honestly didn’t have the time yet.