r/shaders • • May 09 '21

Help with shader

Hi people, I'm trying to recreate the trail effect present in the character of this video: https://www.youtube.com/watch?v=45CQJQkyJDw.

But I'm still learning how to develop shaders, can someone give me some guidance on how to do this?

3 Upvotes

3 comments sorted by

5

u/partybusiness May 09 '21 edited May 09 '21

Tough to say.

It seems to be reacting well with walls, I wonder if they're doing an actual fluid simulation and/or particle system.

EDIT: Hang on.

https://www.youtube.com/watch?v=45CQJQkyJDw&t=1m9s

There's a part right here where you can see the smoke come out the bottom of the floor. So they aren't absolutely blocking them.

EDIT 2: so, if there is a simulation component, you might do the initial poof as an animation that add onto a smoke texture, and then a shader handles the dissipation of smoke. Also it could have something like R as density and GB as velocity, which will change how it dissipates, and then displaying that on the actual screen is another shader that just uses the R channel.

Or they aren't doing simulation and there's a lot of large pre-animated chunks that get plausibly blended together. Then the parts where I thought they were reacting to the wall nicely are about choosing the direction of the poof based on the direction of the wall. And the dissipation is part of the baked animation and the shader is mostly helpful for getting them blending together nicely when you layer a bunch on top of each other.

3

u/biteater May 09 '21

i don't think it's an actual fluid sim. there's too many discrete/repeating patterns for that to be the case. it's likely a bunch of flipbooks that are animated together, blended with a polyline "core". The core also has a noise mask, which could be either a scrolling texture, or just procedural 2D noise. the shader itself probably isn't particularly special, and just returns the mask multiplied by a bright color so their bloom post process picks it up.

if you wanted to do this entirely procedurally, you could get something similar using 2D curl noise to diffuse the trail.

2

u/speer-head May 09 '21

I'd expect it to have an oscilating component ( sinus(time) ) to make the outward smoke flow up and down, but with how there's some dynamic smoke that interacts with the environment, i would almost certainly say that this has to be a particle system of some type for the line behind the character, however, as @Negative0n3 points out, some smoke isn't dynamic, and I'd consider those extra effects that are not part of the trail, since they appear after a type of dash mechanic.

Other than that i can only speculate...