Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

The generic "will this be possible in Unity 5?" thread

Discussion in 'General Discussion' started by thxfoo, Oct 15, 2014.

  1. thxfoo

    thxfoo

    Joined:
    Apr 4, 2014
    Posts:
    515
    As the title says, generic "will X be possible in Unity 5".
     
  2. thxfoo

    thxfoo

    Joined:
    Apr 4, 2014
    Posts:
    515
    Driving vertices from materials:

    In some engines it is possible to drive vertex animations from materials in a flexible way. Will something like this be possible in Unity 5 (without coding custom shaders)?

    In the following video a fish is animated using blendshapes, the blendshapes are mixed with a mask, so specific parts can have different morphs. Additionally, the "bending" of the fish is done moving its vertices along a sine curve. All this can be done by creating simple materials, animation parameters can come from a texture.

    The plant particles in the video grow by blendshapes, its movement is done by sampling a texture and applying the strength to pivots of the model. Again, just a simple material.

    As you see, it seems to be very flexible and powerful for all kind of things to be able to create simple materials to combine multiple effects on vertices.

    Video link
    demo: 16:50-17:30
    details: 22:00-...
     
  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    No, you'll have to use Asset Store or wait for 6.x

    No, you will need to use Shader Forge as of the time of writing.

    Yes you can do this already in Unity using Unity's blendshapes support in 4.x and Mecanim. There is no need for more work such as masks and materials.
     
  4. thxfoo

    thxfoo

    Joined:
    Apr 4, 2014
    Posts:
    515
    Ok thanks.
    1) So I can use a mathematical curve as displacement in Mecanim? Or would I have to create blendshapes before by baking that curve into the model?
    2) The plants in the video move with the waves in the water by sampling a "wave" texture. That works in Mecanim too? (there is a different displacement along the plant, so you could not bake blendshapes for that in advance)
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You should probably learn to use ShaderForge. It makes all your requests pretty trivial. Regarding blend shapes, you can pass a curve to mecanim if you wish, or use mecanim blends for a similar result. you would need the various blend shapes set up.
     
  6. thxfoo

    thxfoo

    Joined:
    Apr 4, 2014
    Posts:
    515
    But with mecanim blends I can just linearly combine existing blendshapes, right?

    The examples given apply the mathematical functions to the vertex positions not to the weights of the blendshapes. So if I understood correctly I could only do this with mecanim blends for functions that are just simple linear combinations of some pre-existing shapes, but not for things like sine or arbitrary waves.

    So I will have to look into ShaderForge. At first look it seems the fish example is probably possible but difficult, but I think the pivot functionality for the plant example is not possible with it (maybe with complex and cumbersome workarounds, but I don't like this rabbit hole).

    But thanks, doing just the fish should be enough for a start (I collected tons of fish meshes without animations, just creating blendshapes and bending the body with a sine function would open a whole world of under water related games for me). And maybe the plants in the waves look even ok without the pivoting.
     
    Last edited: Oct 16, 2014