Hey guys, been lurking around for a while and decided I would finally post something as I think I could probably figure it out but I wanted to get a little outside perspective.
I am building a torch. Mostly everything is already made, but there is a particular facet of its behavior I want to work out.
Basically, fire goes up. When a torch changes its orientation, fire will always keep going up. However, the fire will change its shape quite a bit since its fuel source has changed its orientation. I have provided a simple image describing my setup as this is work related and I cannot show anything in engine cause I don’t want any NDA shenanigans. Anybody who is willing to share a thought or two on this would be appreciated.
This is in Unreal 4.27, and ideally this will all take place within the materials and the Niagara system. Blueprinting is allowed but discouraged for this problem.
My first instinct would be getting the dot product between the particle system’s Local Up and the World Up, that should give you a value of 1 when the torch is upright and a value of 0 when it’s completely flat. You can use that value to lerp between two different scales, positions, etc… both in the mesh and in the niagara module you’re using to set the particle’s initial position.
Edit: Also you might want to clamp it to 0-1 or get the absolute value since whenever the torch points downwards the dot product is going to get into the negatives
Thanks Filo, this did help a lot. Turned out certain aspects were less complex then I initially thought, but this did end up being very useful regardless!
Maybe I’m not getting exactly the problem here, but what about using the fire shader on a ribbon that is moving upward, so it’ll act like fire and always going upward no matter which orientation
My reasoning for not using something simpler was context sensitive. I was working on LotR: Return to Moria at the time and was trying to figure out an alternative to our torch system, which is cool tech on its own but was limited in how it could look and behave.
The major need was for a torch that looked good at a lot of angles; it would have a good set of 3-dimensional qualities while still being performant since it needed to live basically all the time. Again, the material being used (and that did end up staying in the game for release) was made by our tech lead and was clean and performant but was difficult to get it looking like the other fire in the game (which I had made), and cohesion is important too so that’s why I was taking a stab at it.
So I was trying to piece together something pretty and performant with a bunch of parts working together, rather than trying to work out another all-in-one material solution like a single ribbon or in the case of ours, a fake volumetric flame “simulation” that did look good at a number of angles, but was not only extremely narrow in the ways we could adjust its appearance, but it also had a number of angles that would cause major visual flickers due to the nature of the material code. It would frequently bug out on starting and stopping of the torch due to the material needing to do a smidgen of processing right as it started, which could cause a bit of weird framey material shenanigans. Nothing super terrible in isolation, but this was one of the most used items in the entire game, on screen for a significant portion of any playthrough.
Anyway I hope that helps you understanding. Ribbons alone have the movement/physics, but limited 3 dimensionality and material behavior, also particularly expensive when layering for a flame. Sprites have the movement/physics and some of the 3D but don’t blend seamlessly like a ribbon. (Lots of layering transparent fire sprites get expensive fast if there are a lot of the systems) Meshes have the 3D and some of the seamlessness if the material is made well, but are more limited in their movement and can get expensive just like sprites and ribbons if you need a lot. And that is sort of the key phrase for all of this I think. Fire has volume and a volumetric/simulation sort of thing is always gonna capture that really well, but is difficult to make quick stylistic edits to, where as a more traditional system constructed from a variety of simpler emitters can make something that looks better and works better.