Search Unity

Trouble with "Align To Direction"

Discussion in '5.5 Beta' started by Ryan-Gatts, Sep 20, 2016.

  1. Ryan-Gatts

    Ryan-Gatts

    Joined:
    Sep 27, 2012
    Posts:
    54
    Hi all,

    I was very excited to see that Unity was getting the ability to align particles based on their initial velocity -- a feature we VFX artists at FXVille have long wanted from the many engines we work in, but have never had. The main use case this would solve for us is big, aligned, smoke/spark spears that we often spawn as part of an explosion.

    We currently solve this with Stretched Billboard rendering, but there's a big problem: we can never move the spears after they spawn, or they'll rotate to face the new direction! That means they can't be affected by wind or gravity, and have to die pretty quickly so as to not look silly.

    What we really want is a Stretched Billboard that we spawn at a rotation determined by its birth velocity, that we can have never rotate again, no matter how it moves after it's born.

    Unfortunately, the new alignment mode doesn't fix this problem. Regular Billboards spawn with their normal the center of the explosion (as though they were pieces of paper on the inside of a sphere), and Stretched Billboards seem unaffected. Ideally, this would also work with the mesh renderer as well (it currently seems to half-work) aligning their Z axis to the start velocity vector of the particle.

    Is there some feature I'm missing that would let me achieve the effect we want, or am I making a feature request?

    If it's a feature request, I propose that if you are in the Stretched Billboard render mode, and enable Align To Direction in the Shape module, that the Stretched Billboard particles never rotate their alignment direction after spawning, but otherwise act the same. I think this implementation would be fairly intuitive and would not stomp out any other use case or add any buttons to the UI.

    Thanks!
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,762
    Hi Ryan-Gatts,
    Unfortunately the developer who could tell you more about this is on vacation until next week. In the meantime, please turn to our feedback page (https://feedback.unity3d.com).
     
  3. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,864
    Hey, I'm back :) if you also tick 3D Start Rotation, and then set the Start Rotation, you should be able to align the billboards any way you want.

    This extra rotation gets applied after the Align to Direction is applied.

    Does that fix your problem?
     
    Vashchuk and karl_jones like this.
  4. Ryan-Gatts

    Ryan-Gatts

    Joined:
    Sep 27, 2012
    Posts:
    54
    No, Stretched Billboards are not affected at all by Align to Direction
    upload_2016-10-14_12-18-25.png

    And if I try to align regular billboards that I'm using 3D Scale to stretch and then 3D Rotate, they won't turn to face camera.
    upload_2016-10-14_12-21-1.png
    looks good if I'm looking down the Z axis
    upload_2016-10-14_12-21-22.png
    but rotate 90 degrees and the billboards aren't facing you. All other rotations are even less appropriate.

    Rendering the quads as meshes also doesn't work for reasons I really don't understand. The mesh quads seem to be aligning to some axis that I can't make sense out of...
    upload_2016-10-14_12-28-29.png
    upload_2016-10-14_12-29-23.png


    It's fine if billboards continue to orient their normal to the spawn direction, but the ideal version would be stretched billboards that align their stretch direction (tangent?) toward the spawn direction.
     
  5. Ryan-Gatts

    Ryan-Gatts

    Joined:
    Sep 27, 2012
    Posts:
    54
    @richardkettlewell Is the above intended behavior? Is there a workaround to achieve the alignment I want?
     
  6. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,864
    Hey,

    Sorry, I needed to take some time to try and properly understand this problem/request. I think I have it now:

    You want an option where Stretchrd Billboards billboard/stretch using their Birth Velocity, not their Current Velocity?

    Have I got that right?
     
  7. Ryan-Gatts

    Ryan-Gatts

    Joined:
    Sep 27, 2012
    Posts:
    54
    precisely :)
     
  8. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,864
    Great, ok :)

    One more thing: would the stretch amount come from the initial or current velocity?

    So:
    Stretch direction: initial velocity
    Stretch amount: ?
     
  9. Ryan-Gatts

    Ryan-Gatts

    Joined:
    Sep 27, 2012
    Posts:
    54
    That's an interesting question. My gut reaction says that the speed used to stretch the particle is also the birth speed (though, to be honest, I have enough trouble getting the speed scaling settings to work exactly how I want them anyway, so I'd probably do any scaling in the size over lifetime module).
     
unityunity