Home Animation Showcase & Critiques

Growing vines for game use

polycounter lvl 9
Offline / Send Message
Rmunday polycounter lvl 9
As the title suggests I am attempting to have some vines grow on a mesh ready for game engine use however so far I am really struggling to come up with a solution.

All of this is in Maya

Now this piece is under NDA for a project however I will best explain what I have done so far.

So I have some First person arms that are animated, the animation is used for a sequence where vines grow up the arms and over the screen. My first thought was "Cool time to use the curve warp deformer" I got awesome looking results however these results were not able to be baked. I tried baking both the geo and the CV's however when I import it, into unity the mesh is not visible or it imports in but only in its final state without the animation of it growing. The curves are drawn onto the surface of the arms and use a wrap deformer so they follow the arms nicely.

After spending a couple of days racking my brain the next obvious solution was morph targets. I created some morphs starting from the wrist then have the vine go up the arm however this was not working as I expected it to, the mesh doesn't really grow from the base of the vine how it should.

I am banging my head against a wall here, that coupled with an unhappy client who is patiently waiting for me to figure this out is stressing me to high heaven.

If anyone could aid in either baking down the awesome curve warp or directing me on the best way to approach this is I would be super grateful!

Replies

  • Hito
    Offline / Send Message
    Hito interpolator
    You're baking the mesh object with the deformer directly? or are you creating several copies of the deformed object along the curve and using those as blendshape targets?

    Other ways of approaching it:
    rig the vines to a series of joints, can be chain or share same parent joint, motion path them to the curves on the arm. animate the joint scale (I think Unity only likes uniform scaling) and motion path position. can be tedious if you have lots of vines to skin weight. can be combined with blendshapes.
    or
    create more in-between blendshape targets from start to final form. can't just scale the geometry. have to animate the verts. can be tedious if the vine mesh is dense. can be combined with joints to achieve best results.
    or
    use animated shader to "grow" (reveal) the vine mesh. Animated UV, and/or clamping value on transparency channel. May require fair amount tweaking if it's supposed to look natural instead of magical/supernatural. May need shader plugin like Shader Forge or use Unity 2018.1.b10+.




  • Rmunday
    Offline / Send Message
    Rmunday polycounter lvl 9
    Hey @Hito thanks for the quick response. Yeh there are a fair few vines (Around the fingers, hands and arm) I have tried both, baking the mesh with the deformer and creating morph targets, just doesn't play ball.

    The client does have a shader in engine that was used to grow vines on the floor and wall however he deemed it "Too inaccurate" to be used with the arms mesh.

    Hmm would an animated clipping plane work? So the the vines are just attached to the mesh in their fully grown form and then have a clipping plane animate up the arm to reveal the vine? It is meant to be somewhat supernatural.

    Edit: Forgot to mention I also have tried using Geometry caching but the vine mesh itself is rather heavy vert wise, it always freezes on the "Calculating" stage of caching and becomes unresponsive or crashes.
  • Hito
    Offline / Send Message
    Hito interpolator
    animated clipping plane could work, but implementing it in Unity isn't trivial. You'd need set up a special camera and render layers in Unity.

    you have to think through this backwards starting with implementation methods in Unity: Skinned Mesh; Blendshapes; Shaders; custom plugins. Most the cool stuff in max/maya doesn't translate into game engine nicely, you have to pipe them through one of the paths before, or develop custom solutions.

    most straightforward way is skinning the vines in the fully deployed state to joints. then animate it "backwards" to retracted state. Sevarog from Paragon is good example of how this works. This works well if the transition is fast.

    baking the curve deformer won't work. FBX doesn't support it. You'll have to bake a series of blendshape targets,

    modifying the existing shader, or retooling the vine asset to work with the existing shader, might be best option for all around flexibility. look at various ways people implement a dissolve effect in Unity.

    vert caching you could try Alembic export. May have to enable the plugin in maya first. Unity has Alembic support, but takes a little work to set up I think. never tried it myself. I have seen videos of people playing back fluid sim in Unity, exported as alembic cache. Oats Studios made heavy use of it in Adam.

    there may be plugins on unity asset store that does vine growing kind of thing. may or may not work with what your client's already built. and there's cost issue as well.
  • Rmunday
    Offline / Send Message
    Rmunday polycounter lvl 9
    I managed to get it done by rigging up a lot of vines, I am ashamed to say the solution was pretty simple. Rig, skin then use the IK-Spline handle tool to attach them to the curves on the arms then you can scale the vines along those curves by keying the joint scale as long as it is kept uniform. Can also animate the IK offset value on the spline handle if I wish them to move, that isn't really needed in this use case but is an option.

    Only issue I see with the way I am doing it, is the rotation/twisting influence of the curve may need to be keyed at points or the mesh does some weird jitter.

    Now I know! Thanks @Hito for the insight though.
  • Hito
    Offline / Send Message
    Hito interpolator
    yep IK Spline works too! didn't think of it. joint rotation is a draw back, similar to using motion path constraints.

    you can give ribbons a go too, handles joint rotation much better thank SplineIK. otherwise works pretty much the same. hacks maya's hair system to pin joints a long a nurbs surface. A lot of stretchy limbs utilize this set up. It's a really versatile system, if a bit complex to set up in Maya.
  • Rmunday
    Offline / Send Message
    Rmunday polycounter lvl 9
    I will look into that when I have got past the contract! Thanks so much man.
Sign In or Register to comment.