I`m glad to share a work what I do for fun recently.
It is a flow trail shader in Unity 2018.2.4.
Amplify shader editor 1.5.8 for shader.
Substance designer 2018 for the texture.
The shader graph. (Full size link: https://drive.google.com/open?id=1x5fW5yX-r6p6mdbO35OrLzPlvdqmmhDG )
The overview of the shader is included 4 part.
First: Define the main shape what I want for the trail.
Second: The way how to dissolve the shape. So I need a good motion for the mask.
Third : Fill the color.
Final : Optimize the visual. Mask some defect.
Here is the texture made within Substance designer for the shader.
RG: Work for distort the uv and the end of the trail dissolved.
B: The main shape of trail.
The first step.
Do the main motion of trail. And add a little distort noise at uv coordinate for B channel.
There is a tip that is the node “Constant Bias Scale”.
It remap the value of noise from 0~1 to -1~1. As a result, it will keep the distorted trail at the center.
And I multiply the gradient of U coordinate to keep the shape in the start position and more distortion in the end position. As the result, the shape of trail will be more variety.
As the trail moving to the end will be dissolved by the noise from G channel.
In order to keep the initial opacity, it add the gradient of U coordinate.
To fill the two color from start to end. It is filled full size.
If it multiplied the value of opacity, the pixel which less than 1 goes to black.
So, I created a switch to do the dark edge or not.
As the value of “Flow Strength” went over, the trail will move over the area.
So, I need a mask making it to be smooth fade out when it over the edge.
That is all.
In fact, there is no more special. But just within some adjustment to make it better.
Please feel free any feedback or idea. Thanks!