Broken particle rotation when 90 degrees is exceeded

Hey all,

This effect is hard to explain so I’ll attach a video…but this effect happens on both Unity 2021.16.4f1 and 2022.1.4f1.

It seems like the particle gets gimbal locked right at the top and then spins it around to correct itself, rather than just rotating past the top. Like I said, hard to explain so please check the video in the ZIP.

8200080–1069557–particlebug.zip (1.24 MB)

Bump

Ignore the particles. Is the Transform itself gimbal-locked?

If you are doing any of this by manipulating the eulerAngles property, you WILL get gimbal lock.

Here’s why:

https://starmanta.gitbooks.io/unitytipsredux/content/second-question.html

I’m just an artist, not much of a programmer…but I’m just rotating the camera, not changing any transforms. I basically just am using everything as it comes with Shuriken. :\

Bumping again…

Can’t enable roll because stuff like this happens:

So how can I make the particles not look so bad?

Hi!

The behavior seen in your original video is not a bug: that’s what you get for a camera-facing plane, whose local “up” axis must be aligned with the world’s “up” axis.

Now if you enable “allow roll” in the particles, they will roll together with the camera (that is, get their “up” vector aligned with the camera’s) which is what you see in the second video.

In this case if particles continued facing the camera when it rolls up past the zenith (90º up), they would cease to be correctly aligned with the world. If you flipped the camera completely so that it’s top touched the ground, particles would be flipped upside down completely (relative to the world).

There’s no other ways of making a camera-facing plane. This is an inherent limitation of approximating an object with a simple plane instead.

If you want better looking fog/clouds, you might need to try a different technique like volumetrics.

Hm…so a lot of older flight sims used particle clouds but rarely experienced the flipping problem because they oriented the particle with the camera and allowed it to flip upside down. How hard would it be to replicate that behavior? Or is there some other way that they did it?

Example;

What shoukd happen when flying directly above a cloud, looking down on it? Would it look “up” or “down”? At which point should it flip to keep its orientation aligned with the world?

I guess you could change the world’s “up” direction used by particle quads to align it with the camera’s up when the camera looks up/down more than 45º, but that should be done in a custom vertex shader. I don’t think it is possible to do custom aligning directly in the particle system inspector.

Thanks for all your help with this. I guess what it should do is keep the same world normal but invert the polygon when it switches…

I’m trying to see if I can use the VFX graph to build some logic in to flip the polygon when the angle exceeds a certain amount. Unfortunately I can’t find a simple boolean switch operator in there - is it something I’m missing?

EDIT: Nevermind, it’s “Branch” for anyone looking at this in the future.

1 Like

You’re welcome! :slight_smile:

Wouldn’t inverting the polygon instantly (and hence the texture in it) be more jarring that the default behavior of smoothly rotating towards the new orientation? I was under the impression that you were looking for an even smoother result, that’s why I suggested 45º as the point at which particles begin interpolating to the new “up”.