Unity Particle Mesh Orientation

–If you are using latest Unity Beta 2017.1, this problem doesn’t exist anymore.–
–If you are using Unity 5.5 or 5.6, here is a solution.–

Hey guys, just a quick one,

Does anyone have a clue how to get particle meshes in Unity to orient with velocity, like stretched billboards do?

In Unreal this is a beloved feature and works out of the box. So strange Unity doesn’t seem to have any effective option for this. Just heard of some people going in via script and reorienting every single particle mesh in the update function. They say it is expensive, but maybe I should test it, wonder how it deals with 100 meshes though.

I found one script which replaces the “particle mesh renderer” completely and also applies stretched billboard orientation to those meshes. But it might not write the particle color to the meshes vertices… which would leave one with no shader access. Anyone experience with that? it is called “Mesh Particle Renderer”.
Don’t know if that script works at all in newer unity versions, price tag is a bit astronomous, but I might be willing to pay if it just gets me the basic functionality like in Unreal. I wrote a quick mail to get more clues, but answer still pending.

How about you guys, did you get mesh particles to orient via velocity at any point, or ever had the need?

1 Like

I’m not a unity-guy but I attended a little talk about Unity 5.6 and there they mentioned a new velocity property. It didn’t seem to me that it works exactly like Unreal does but maybe you’re lucky. Which Unity version are you using?

Didn’t see anything about a new velocity component in the 5.6 release notes, but just had a look at the release notes of the latest beta 2017.1.0b2:

  • “Particles: Mesh particles now support the same Render Alignment options are billboarded particles”

Could this be it? That would solve it, in the future… The project I am working on is on version 5.4.2f2 though.

Will definitely try out the Beta and see if it does the job, but also still scavanging for an older solution.

Here you have the slides of the presentation I’m talking about. On page 2 you’ll find “Align to Velocity”. Is that what you need?

I also thought about if it’s possible to let the vertex shader do the rest. If the velocity could be handed over into the shader, maybe it could be done there and this might be cheaper than iterating through all the particles one by one. But I’m talking right out of my a** here … no idea if this is even possible. :slight_smile:

1 Like

Cool thanks for sharing the doc, looks like this option is for billboard particles only though, just improving on that, which is good!

“They do not attempt to face the camera”

  • typically that adds some unwanted “bonus” jitter to the particle movement
    “The Rotation Modules can be used with them”
  • sounds nice, you don’t have to have the shader/texture face in the right direction to align with velocity, use particle rotation to get the texture facing the velocity direction… Cool!
    “They do not stretch”
  • they stretch by default, so eventually nice to have

I also thought about the vertex shader, but as far as I could see you can access the mesh rotaion via vertex stream in 5.6… but, velocity is not applied to that rotaion and I guess you can’t stream the velocity vector seperately. But this is pulled from nowhere specific, too!

EDIT: Just saw there is a velocity stream in 5.6! Don’t know how to access the vertex stream via ShaderForge though…

Maybe an option could be to use the trail system. Because they’re aligning with velocity and as far as I know you can define how long the get, how wide they are and so on … could that be a work-around?

In my case I want to have 3d Drop-shaped meshes to create a massive fluid splash.
With using 3d meshes I hope to get rid of less credible look for splotches flying towards the camera or away from it (thin meshes rotating wildely in length axis!).
Other than that I am using 2d billboards already, which work nice with velocity alignment in the hotizontal and vertical plane. So I don’t know if trails would improve on that.
I thought about restricting the splash emitter to emit droplet shapes in that screen plane and then emit round shapes with less vertical movement but al ot of depth movement on top.
3D mesh would also simplify the fluid shading a lot, but I can get away with faking that in the shader.

oh, procedural 3d mesh trails could be a way out, but they are a pain to implement afaik… could use the horizontal size or gradient of the mesh trail to get a nice dropletshape I guess

  • but then, I could start thinking about just to go the full way and throw real dropshape physics meshes around, since I have to throw something to attach those trails to, anyways.

Will go for a simpler 2D particle solution for now. Thanks for your help man!

Btw. Learned a lot from your Blog and videos. Keep up the great work!

ah -.- didn’t read it to the end, blimey. it says:

Mesh Particle Improvements

We have made some improvements to mesh particles, to give them greater parity with their billboard counterparts. The biggest change is that meshes now support all the same alignment options as Billboards. This means you can align them to the camera, to their transform, and to the world, etc. A second, smaller change, is that the Align to Direction option in the Shape Module now also works for mesh particles.

This is super cool! Looking forward to use this later on in a future project! Cheers

Edit: Guess for most people just upgrading to a newer Unity would be the best solution for using aligned mesh particles in Unity!

Second Edit: For me, I am still looking to get this at least to work with 5.6 and shaderforge somehow, will post a solution if I find one. Any ideas appreciated.