My Profile Picture

Danny O Mejia

Tech Lover

Shaders and FX

This is a place where I will be creating FX in Unity outside of work for porfolio demonstration and practice.
Fire; Alpha Blended Particle Shader
Down below is an image of a shader I created. It is the foundations for all particle shader. It will build up from here. This shader essentially grabs the texture and its alpha and multiplies it with the Vertex Color note then outputs it. Multiplying noise helps with FXs like fire. Lastly, and the important part is that this version of the shader has it's Blend mode set to Alpha. This will help it in bright environments and an additive version can be added on top. In order to read it more clearly, please zoom in or download the image.
Fire; Additive Particle Shader
The shader below is almost identical to the Alpha Blended version on the image above. The only differences is that it's blend mode is set to additive. This one acts more like the default unity shader, where stacking particles eventually changes the color to white(overblown). I like to use this one on top of an alpha blended shader so that it pops the particle colors instead of over blowing them.
In order to read it more clearly, please zoom in or download the image.
Fire; Distortion Shader
The shader in the bottom image grabs the screen and I distorted with some noise and alpha mask so that there isn't any hard edges around the distortion. I used it in a plane in the center as a heat haze fx. It can be used in a particle system, but it will be taxing on the system. For demonstration perposes, I created it to work with the shuriken system (CPU), but it can easily be switched over to Unity's Visual Effect Graph that uses the GPU instead. In order to read it more clearly, please zoom in or download the image.
Fire FX Demo

Going through the particle.

This is me going through every piece of the particle. First the alpha blended particle so that the fire does not get lost in bright scenes. Second, the additive particles to that the fire glows. These particles follow in the same direction that the fire goes. I added some embers, but there there isn't any wood. The light helps the fire intact more with the scene. The same is true of the heat haze.

Take a look

Clouds; Panning and Adding Noise
My next fx was going to be lightning, but how will that look without clouds. So, I created some clouds by using noise generators. Down below there is noise nodes that are panning with the time perimeter. Simply, plugin in time and multiplying that by a number can speed up the noise movement or slow it down. I left 1 noise node static and added them all together then divided by the amount of noises so that it is not over blown. This is just one piece of the bigger puzzle.
In order to read it more clearly, please zoom in or download the image.
Clouds; Vertex Offsetting
Next was to plug in that noise and offset the vertices base on the normals. This will make the clouds pop out and not just be a plane. Of course, the plane has been subdivided in Maya so that it has enough geometry. Also, the final cloud color is dependent on the noise's 0-1 because I am blending two colors together for the clouds.
In order to read it more clearly, please zoom in or download the image.
Clouds; The Alpha
The cloud transparency comes from the combine noises' 0-1. I added a fresnel then inverted it in order to fade out from back to front. This allows me to fade out the plane so that it blends with the fog.
In order to read it more clearly, please zoom in or download the image.
Clouds; Close your eyes!
Yea...It is a mess. Down below is how the final shader looks in the shader grapgh. I have attempted to organize it into different groups, but in the end it is not so clean without using variables which they do not exist in Unity's shader graph. Set and Gets like in Amplify Shader Graph would be very useful. All in due time.
In order to read it more clearly, please zoom in or download the image.
Fun with the clouds

Going through the "particle".

In this video I am demonstrating the parameters I left public. This allows the clouds to be integrated into any scene. The shader itself still need a lot of tweaking, but in the end it all depends in the art direction.

Take a look

© 2022 Copyright: Danny Oniel Mejia