- Home /
Unity3D question about the Procedural Generation engine for creatures in Spore?
When you drag a limb to the body in Spore and it attaches to the body, not only does the bone rig obviously connect (which allows the limb to move with the body - which I think I mostly know how that works), but the SKIN of the mesh of the limb connects directly to the skin of the mesh on the body seamlessly.
I assume that the limb is a separate mesh from the body, so how do the two meshes become "one"? NOT the bones... that's another question. I'm asking about the skin (the faces, aka the wire-frame, the polygons) of the meshes, how they become one.
What is this called in the 3D modeling world, where the skin of two different meshes connect together when they are brought close to each other? Is there any information online that describes how this might be done in Unity3D?
Answer by testure · Jul 05, 2011 at 05:38 AM
there are plenty of ways to do it, and none of them are 'magic' per se- take a look at marching cubes, voxel based geometry, or even something as simple as booleans. None of them are fast, but all of them are well within a modern PC's capabilities. Spore used a very specialized engine designed for this purpose, i'm willing to bet you wouldn't be able to get this kind of quality/results with Unity3D without some VERY serious optimization work.
On that note, I saw this on the asset store the other day- it's somewhat related to what you're talking about, and it uses voxels:
Thanks for the answer. $$anonymous$$arching Cubes looks very excessive. Surely someone has already done this in a more simple way? be aware that I'm not trying to make the whole meshes from scratch. I just want them to seamlessly connect when they touch each other. The only part of the meshes that should be recalculated should be the parts that touch.
then what you're looking for is called a boolean. the original red faction did their world-destruction technique with booleans.
here are some discussions on the topic:
http://forum.unity3d.com/threads/16407-boolean-operations-on-meshes
http://forum.unity3d.com/threads/85713-Boolean-Subtraction-Operations-on-$$anonymous$$esh
now- keep in $$anonymous$$d that if you're planning on doing this with a skinned mesh, get ready for a whole world of hurt. $$anonymous$$axis spent years developing spore's procedural skeleton/meshing system. It's relatively straightforward to do it to a static mesh, but once you add animation/rigging to the mix, you're asking for trouble.
Sure, it would be hard, but considering how quite basic the Spore creatures are, it's not all that $$anonymous$$d-bending. Will Wright certainly talked it up prior to release, but it's hardly as awesome as hyped (nor was the rest of the game, though my kids still seem to love it).
Blender's metaballs are all just polygonal when rendered.
Yes I'm going to be doing it to skinned meshes that animate and are rigged. However, I want to disagree that it is necessarily going to be that difficult. Because the animations are applied AFTER the merge calculations, and thus, the merge itself shouldn't interfere with the animations, nor should the animations interfere with the merge. Remember that every mesh is a static mesh prior to each frame of an animation being calculated, and that's when the merge processing would be done. So it would be a static mesh, merge calculation, then animated frame 1, and displayed to user. Then static mesh again, new merge calculation, and then animated to frame 2, and displayed to user, etc. I do not, however, really want to see boolean operations on meshes, because that just reduces polygon count and simplifies meshes. I want to merge two meshes. That may use some boolean operations, but I'd rather hear a more specific guide to merging meshes rather than just simplifying them.