Recreating this effect on Unity VFX?

ds3b

Hello !

I’m trying to copy some effects from Dark Souls 3, especially the trail effects of some bosses (not the trail of the weapon itself, but the fire effect in this example).

While it seems like a pretty common effect, I struggle on a few points to get something similar on Unity. I found 3 approach :

  • Dynamically emit a ribbon (particle strip as unity call them) from the sword, but since the animation is fast, it breaks the ribbon.

  • Create a ribbon mesh and render the texture on it then animate it correctly to synchronize with the sword motion. While this is less flexible, it also solve the broke ribbon. BUT, I still have one problem : in my example, the ribbon always faces the camera while still keeping the initial curve, to avoid getting a “2D” fire, which isn’t very convincing. Ribbons spawned by a particle emitter can do that too, but I have no idea how a mesh could do the same.

  • I could also spawn particles quad along the trajectory with some animated texture, but it wont look like a continuous, moving fire like it does on the gif above, which is precisely what I find interesting in this effect.

Most slash effects I saw, if not all, are rendered on a flat mesh, which is ok for giving a sharper feeling, but in that case, the fire look like a volume, which is slightly different, and used a lot in DS3.

I hope I’ll get some advices on common methods used to achieve these effects, I’m really discovering VFX right now !

Also, here is a link with a screenshot so you can see the effect without movement. I can also link a video if you want.

DS3 VFX

Thx !

EDIT : Hope I’m allowed to post content from a game, tell me if it’s not ok :sweat_smile:

8 Likes

Hello @Skullhack!

I’m not sure exactly what they did in this specific effect… However, my approach would be to create 3 effects together:

  1. A trail emmiter attached to the sword that activates with certain animations (in this case the sword attack)

  2. A particle emitter, using “rate over distance” that activates with a little delay, compared to the trail. I would make this emitter with a flip book texture (like you mentioned in your third point).

  3. Fire Sparks made with the particle emitter, using the default particle texture of unity (or something similar). This one seems to have a little delay as well (not sure)

To make this as awesome as they did in DS3, you need to nail the timing and have a good flip book texture.

That would be my approach =)

Anyone with other ideas?

Hello !

Thanks for the answer.

Your 1st and 3rd points are exactly what I did, and it works (except for the velocity of the sparks but I’ll tackle this porblem later), no major issue here.

For the fire effect, your second point, I don’t know if we can really see it in my gif, but with a video and in game, you can clearly see 2 effects : first, a brownish ribbon of fire that moves along the trajectory of the swing, then this ribbon ignites into the explosion.

The explosion effect is probably a quad with a nice flipbook, as you said, with some sort of rotation (or simply oriented along velocity). What you said will probably work. But I’m struggling with the initial effect : the fire ribbon. Either I spawn it dynamically and get a broken ribbon, or go with the premade mesh and get the “facing camera” problem.

Everything I try, I struggle on little details like these :sweat_smile:

Hmm… maybe I’m not understanding very well what you meant by “fire ribbon” (sorry, english is not my first language :sweat_smile: )

I thought you’re talking about this part that I’ve marked with pink, isn’t it?

Capture

If it is… this is definitely made with a trail emitter, attached to the tip of the sword. Well, at least I think it is haha

If you’re talking about another part that I’m not perceiving, please show a static frame, so I can understand it better.

Also, if you already have implemented a little bit of the effect, could you post a video or a gif showing how it is at the moment? Maybe I can help you improve it the way you want =)

Ah ah don’t worry, english isn’t my first language too. Sometimes it can get hard to explain complex effects like these. I was talking about that part :

In that screenshot it’s the first effect that goes into the explosion which you can see in the gif.
This is the part that gives me trouble.

I’ll try to show you what I have right now if I can fix the mess it became after all my attempts :sweat_smile:

It is possible that I’m overthinking this and that there is a “simple” method to render this type of trail, but I can’t find a way that doesn’t involve heavy scripting or premade meshes.

Getting that smooth 2D arc trails is better achieved using the trail emitter offset under a parent with the trail started far sooner in the attack than you expect, usually at the very beginning but kept invisible.

The parent activates in mechanim at frame 1 synchronized with the characters attack sequence and uses 2 animations

  • Anim_X1 - Places the parent into the desired pivot location + angle the parent into the arc plane with the weapon

  • Anim_Y1 (8-12 frames needed per 90 degrees*) - This rotates the parent to create an arc for the trail

  • Anim_X1…2…3… can be multiple anims for a multi-hitting sequence. If the character attack has no change in arc plane then it only needs 1 frame. This allows you to kill its computation immediately after it’s needed

  • AnimY1…2…3… will be used for different arcs, 60, 90, 180, 270, and 360.

By splitting the operation of VFX like a machine you get the ability to simplify and re-use simple data for many actions. 1 operates the positioning of pivot the 2nd operates the swinging arc

The arc rotation action is started at the start to ‘pre-spawn’ the trail mesh into a smooth-enough arc rather < 6 frames quickly the moment it ‘should’ spawn

You just don’t display the trail until you are ready - use another Anim_Z through mechanim with the attack sequence to drive the emitters trail mesh visuals --gradient, variables, tint.color, w/e you need on the material. you can drive width or displacement if the shader has an exposed noise on the vertex level. Some of the data can just be on the trailObject parameters, depends how unique and flat you want this data to exist in project / on device

this parent_node > child_trail can be pooled into the game and instantiated under the character structure to follow along should the characters movement need to adjust the trail as well.

the downside is this is not a ribbon, the trail is 2D and and will be used for agnostic sizing that does not describe the blades actual dimensions, so for flurry of energy only. However a seperated anim in mechanim can also read a parameter to factor the width incase you have dynamic weapon sizes that affect the energies size

does this make sense?

2 Likes

Now I understand what you’re having trouble with!

Look, I believe this is much simpler lol

If I’m not wrong, this is the same particle emitter of the “fire explosion”, attached to the sword. It’s the same flip book texture with the “rate over distance”.

I believe I was wrong when I stated that there were a delay with the explosion… This emitter seems to activate right at the beginning of the animation! However, it seems to have a “color over lifetime”, it starts with a desaturated red and maybe about 50% opacity in the begining (this gives you the “fire ribbon” effect). And then, the saturation raises with 100% opacity, and this makes the explosion. Finally, the opacity/saturation rapidly drops down to 0 again, making the explosion fade away.

The raising of the opacity/saturation over life time creates the effect of the ignition with the delay.

What do you think? Does it makes sense?

Very good idea ! I didn’t thougth of changing the colors to get a new effect !

The only problem left is the speed of the animation : it is so fast that the effect will “break” at the some points (giving hard edges instead of a smooth curve) and that’s one of the main problem I have with most effects driven by a fast object, like the sword in this case.

1 Like

Thanks for the long answer !

I think I understand the method you described. If I’m not wrong, you need a few basic trail meshes for the different swing arcs (60, 90,…) if you want to reuse them in different cases ?

Also, is there any way to solve one of the issue I have : making the mesh face the camera without changing the curve ? Something like “twisting” it maybe (like a particle ribbon is able to do) ?

the trail likely needs some alterations between 90 vs 360 for pre-generating; some artistic reasons will arise depending on your goals, but many parameters can be set on the key frame level.

the trails are 2D and align with the camera, i am not sure if you can override it much without getting into custom shader work exclusively

the ribbons allow you to twist the mesh but to give it cam facing logic requires shader work as well to prevent oblique pinching.

if you need both I’d just use both for their strengths, 1 ribbon system to inherent twist so that it follows the weapons edge in 3D space and 1 trail for the glowing bulk 2D look of the effect

This is just my read on how it was done, but I think there is miscomunication in this thread:

I could also spawn particles quad along the trajectory with some animated texture, but it wont look like a continuous, moving fire like it does on the gif above, which is precisely what I find interesting in this effect.

(I personally think:) This is actually what is happening in this case. The Trail is the bright line attached to the sword that matches the exact swing. The Fire is a series of particles that are aligned in the direction of the swing, and facing the camera. They animate through a flipbook, with some kind of panning noise across them to break them up.

I think this because you can see each particle step through is animation. See here how the back half of the swing is full of smokey flame particles:

In the next frame, new shapes appear here, this is the blooming “fire” effect that explodes through the arc of the swing. It has very sharp edges and a repeating pattern that I believe to be two particles:

Now the color of all particles changes at once, but each particle is still stepping through it’s flipbooks individually.
Here I have marked a particle that looks squashed by it’s angle to the camera, and drawn what I imagine a quad would look like of a single particle:

I think it’s a really impressive effect, that looks continuous through some smart shader work on the flame particles. There is also some secondary tongues of flame shooting off from the fire at the end as is breaks up, and of course lots of sparks and embers. The core feature that makes it feel unified is the gradient mapping that has the colours bloom in unison while the animated material of each particle plays in sequence.

Why I say there is miscommunication, is that I think you will have harder time making this with trails. to mimic this you do not want to create a set of unique trails, but to attach particle systems to the weapon itself - that’s why the core trail of the blade is so wobbly.

3 Likes

Hey !

I’m very late to answer, sorry for that. Your understanding of the effect is closer to how I understand it too. I still think the “smokey” fire (before the blooming particles), is either a ribbon mesh, with a scrolling texture and a progressive alpha, and some very clever trick to make it twist and always face camera, or just a dynamic particle ribbon that repeat a scrolling texture on each segment.

The blooming fire are particle quads as you said I think, since we clearly see them repeat (it’s just too fast).

This topic really intrigues me. I am working on a character that swing its sword around so I think I should try to figure this out while I’m at it.

I am fairly sure that the ‘smokey’ fire is another particle emitter that is attached to the tip of the weapon.
I think the emitter is a Cone one with narrow angle, and was rotated so that it is almost 90 degree to the weapon.

Emitter

FireMotion

The expected motion of particle along the arc of the swing.

With the cone emitter spewing fire forth while being perpendicular to the tip of the sword, it creates an illusion of a ‘trail’ that kinda moves along with the swing of the sword.

Now, the particle itself morphed and twisted toward the camera with what I presume is a ‘Stretched billboard’ render mode. This render mode will make the particle attempt to face the camera while still respecting its trajectory, making the particle appear “full” from all angle

StretchedBillboard

Lastly, the emission is set to ‘Rate Over Distance’, so that the particle would spawn as the emitter moves.

Emission

With some experimenting, here is the result

childEmitter_01 childEmitter_02 childEmitter_03 childEmitter_04

In the Animation Timeline, I simply deactivate then activate the emitter at the proper time, then set emitter duration to the duration of the swing without it looping.

Now, my emitter is not perfectly perpendicular to the tip of the sword since I try to go for more outward motion, so some particle does look flat despite being Stretched Billboard. Still, it is now a matter of adjustment and you can experiment with it!

(I believe that with proper fire texture, it would look even more convincing)

Now, there is a small problem.

The only problem left is the speed of the animation : it is so fast that the effect will “break” at the some points (giving hard edges instead of a smooth curve) and that’s one of the main problem I have with most effects driven by a fast object, like the sword in this case.

The Rate Over Distance can turns the trail flat if it was too fast or if the game lags (in my experience at least). It can actually handle most swing well, but if you really want a smooth curve, you can try using “Circle” emitter.

Make sure that the emitter is not directly parented to any part of the character.

Set the Shape to ‘Circle’, expand its radius and move it around so that it would be approximately on the tip of the weapon. Set Arc Mode set to ‘Loop’ and ‘Speed’ set to 1/(Emitter duration)

Emitter02

Set its emission to high rate.

Emission02

Now, without any interference, the particle would just simple shoot out from the center. To counteract that, we will make the particle ‘orbits’ so that it would mimic the motion of ‘moving along the arc’.

Orbit

The further Orbit is from 0, the more perpendicular the particle would be. I think 1 or -1 is enough

The result:

circleEmitter_02 circleEmitter_03 circleEmitter_04

The trail is very clean and uniformed, but the arc is fixed. You can experiment with Arc value to shorten the ‘trail’

You could combine both method to your liking! Here I use the ‘Rate Over Distance’ for two initial swings which are slower, and use circle emitter one for a fast, AoE swing.

mix

3 Likes

I was reading your answer to my other post, thanks a lot for both answers !

WoW ! I didn’t even think about your solution, but it looks really nice ! I think I prefer the first slightly broken version because it looks more chaotic and fiery (which is precisely the effect wanted). I’ll try to imitate your solution with VFX Graph instead of just copying what you did, it could be a nice exercise, and I think VFX graph “update” more (I mean more by frame), allowing a smoother curve, I think.

Your solution is great for the “explosion” effect I think, but the initial “smokey” trail still look likes a ribbon. But maybe with a second texture your solution can create the same effect.

The particle you spawn themselves, they are big quads with your own shader + texture ? Because they look so good, especially the dissolve effect.

Really nice work for something you did “while at it” XD

The particle you spawn themselves, they are big quads with your own shader + texture

Yeah, everything is big quad! I personally think shader and texture is very important here. The initial smokey trail of mine is very faint because I uses a stylized fire shader that was meant to be looked from distance haha.

I underestimated how good a big square could look. As you said, texture + shader is much more responsible for the final effect than the way the particles are emited. Your effect is really close to DS3 in my opinion, addind some more flame tongues + embers you basically have the “explosions” already done.

Thanks a lot !

2 Likes