Unity Shader Graph - Waterfall Effect Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome back to Gabriel G and this time I'm going to show you how I created this waterfall scene some people have requested this over the time and here it is finally and as you can see it's very stylized it's great to complement the scenario similar to this one with hand painted Texas or even for a low poly scene or something along those lines and in case you want to download this scene I left the link in description it's available my patreon page your support will help me a lot and you will also get access to other projects with more shaders and visual effects too so with that being said let's see how we can do this All right so if we break this apart we have the waterfall which requires a mesh similar to this one and we actually don't need any text for the waterall but we will need a special Shader and there's also these ripples at the bottom that uses its own mesh a special Shader with a texture like this one and then we have a few more particles and a few more things to complement the whole idea of the waterfall but this water right here is from a previous video this one and you can find a link in description in case you want to replicate it so for the waterfall I started with the mesh and I used a blender where I started with this PL which are rotated like this and then added a few more Edge loops with contrl r vertically and horizontally as well and this part basically depends on the shape of the waterfall you want to achieve so it fits in your scene and in my case I wanted something smaller at the top and larger at the bottom I also made it rounder instead of being straight you know and up here it will be the connection with the river supposedly then finally I just inclined this a little bit just like this once I modeled the waterfall I use the subdivision surface modifier to increase the face count so it's smoother so the vertex displacement that I'm going to use in the Shader looks better I also smoothed the mesh as well as change the pivo so it's at the bottom like this now one important step is getting the UVS right and once I unwrapped this I got these UVS which they are not very helpful for what I was trying to achieve what I needed is for the UVS to be square to be straight but first I added a few more Edge Loops because it will make the waterfall shade look better and then I used the light map pack from the unwrap menu and with the face selected I unwrap it again but as follow active qu heading up with this straight UV map now it doesn't need to be super cented but it needs to occupy the wall UV area like this and the mesh is done so I decided to move on to Unity where I made sure I imported the mesh with a SC factor of 100 so it matches the unity unit and yes I could use this mesh separately like this but I decided to create an empty and add the particle system because it gives more features and it opens more possibilities with the waterfall and this particle system is super simple all I did was set the start Speed to zero the emission rate to zero because I'm going to use a burst with one particle and I also turn off shape and on here in the render mode I switched this to use the mesh and assign the waterfall I just created in blender and also set the render alignment to local so I can rotate this in whatever way that I want and I assigned the material as a place holder but the geometry was acting weird so I went back to blend and I noticed that I forgot to apply the scale with contrl a now it was looking good and all I needed was to rotate and place the waterfall in place so I could proceed to The Next Step which is creating the Shader and I use an unlit graph because it's lighter and I didn't want to use any light information now for the Shader I used the UV note and a Time note since I'm going to need to scroll a texture to simulate the water movement and basically I multiply at the time with a vector to call it reple speed or you can call it water speed which is going to move a varanoid texture like this one and a varanoid node also allows me to add movement to the cells basically to the angle offset creating a more Dynamic water and now to test this out I created a simple material out of this Shader and then assigned it to the waterfall particle system I was able to control these three settings and adjust the text to fit the scenario just like this and at this point I noticed that I needed more controls like like for example the density of the ripples can be easily controlled with a power node like this then I also needed to control the color which was set to HDR mode and then I created the basic setup for the color basically we multiply the texture with the color and multiply this result with a Vertex color which will enable us to control the color of the Shader via particle system for example it's very useful and this allowed me to add color but as you can see it has too much dark too much darker colors and near the bottom we want this to have foam to be white you know so to avoid having too much darker colors between the ripples I had to remap the lower values the zeros basically to be 0.1 or higher and for the foam at the bottom I used another noise a simple noise in this case and I can get a nice ramp fade by splitting the UV node and inverting the green Channel with a Y minus node now with a power node I was able to control the fade amount and now I only needed to multiply the power with the simple noise and by using another remap node I was able to control the brightness of the foam at the bottom now I only need to add these two together and that's it once I got back to the waterfall I adjust the strand of the bottom foam giving me this bright fade thanks to the ramp and I also adjusted the color intensity for example the ripples them out and also made sure this was a vivid blue to match the water on the lake it was starting to look nice but there's still a few things that I wanted to add like for example we can add a simple vertex displacement and for that I Ed the position node set to object giving me access to each vertex and allowing me to influence their position with the vono noise but uh I first multiplied that with a vector one so I can have control in the inspector over the vertex ofet amount and this is going to be connected to the position basically and that's it and now this allowed me to control this truee direction I think a value of minus 0.25 gives a nice vertex displacement but you can play around with his values if you are following the tutorial and basically now if I increase the brightness in the color I also control the Extrusion amount which is not ideal so instead of passing the vono with the color I simply passed the vorono to the vertex offset allowing me to have more control over the brightness without influencing the vertex displacement Mount basically I also added a control for the bottom brightness with a remap and at this point it was looking fine for now so I decided to start working on the reples and as I showed in the beginning I'm going to need another mesh so I went back to blender where I started with a circle of 32 vertic and in edit mode I extruded this faces scale it down like this basically it's a disc with a wall in the middle now I use the same method to create the UVS basically light map back then select the face and choose follow active quad ending up with this straight UV which I only need to cented and scale up to fit wall UV area now I also added a few more Edge Loops because these will add a nice touch to the ripples now I imported this to Unity and duplicated the waterfall particle system and assign it the reples mesh but as you can see this doesn't look like much basically we want to end up with something like this so we are going to need a special Shader and a texture and for the texture we want something similar to this and it's super easy to create this and it's a seamless text by the way so I created a new Photoshop file with 1024 by 1024 paint background to Black so we can see what we are doing and with a white brush I quickly painted these waves just like this now the idea is to come here to filters and in others we want to use offset and we could choose horizontally or vertically I'm just going to offset this minus 512 because it's Al of the resolution of this image and I'm going to end up with this Sim which I can delete it and redesign again connect it like this and now again in the offset I'm going to do the same butt horizontally and I'm going to fix these Sims right here just something quick to show you the idea okay once I had this nicely done I added some alter glow and exported these without the black background and as a PNG to Unity now in unity we are going to need another Shader so I created a new Shader an UNL graph call scroll Shader and for this scroll Shader I'm going to need the color property set to HDR and also a main texture the main text is going to be connected to a sample text 2D where I assigned the Ripple so I can see what I'm doing and I also needed this to be transparent and to side as well okay now the idea is to make this Scrolls I'm also going to use a UV note and a Time note the time not is going to be multiply with a scroll speed a vector two and then we are going to add this to the UV note and if we connect this result to the UV input of the sample textor we don't see much but it's scrolling it's there and then I created the basic setup for the Coler for the alpha so we can have transparency I needed to split this result and connect the alpha I wanted to test this out on the mesh so I created a material out of this Shader and rename it to Ripple 02 in this case made sure the texture was assigned and also assigned the material to the repulse particle system and I end up with this nice Vortex and at this point it was looking nice but we have these hard edges near the end of the circle so what I needed to do was to create a mask now it's going to have a text similar to this one and it's going to be multiplied with the main texture just like this basically with this texture done I wanted to have distortion on the waves on the main text and to have distortion on the main texture I distorted the UVS basically and one way to do it is by using a LARP note basically the a option is going to be the UVS without any Distortion only with a scrolling parameter and the B option is going to be the UVS with a lot of distortion and then we are going to control the amount we want with the T input of the lurp and for this setup to work I I use the varano noise which is also going to have a scroll speed controller basically all I have to do was to add the result of this vono with the scrolling UV just like this and connect this to the B option and now when I went back to Unity I was able to control the Distortion amount as you can see very useful and it was start to look nice but I also needed another feature basically I needed this to have a dissolve property I needed to dissolve the main texture I use it again alert node basically the a option is going to be the texture without any dissolve and the B option is where we are going to dissolve a lot our text and then the T option is going to control the amount we want to dissolve and for that I basically multiplied the main texture with the voro that I created previously and connected to the B option I also added a param to control the D option the amount that will pass between the A and B and before connecting this to the next note I used the power node to control dissolve power basically I was able to this Sol the text nicely creating these nice reples with a little bit of adjustments I end up with these values down here but since I wanted more diversity and since I was using particle system I was able to add a random start rotation between 360 minus 360 add a random start lifetime to the reples between two and four or more as well as using a rate over time of only one which was enough for what I wanted to achieve the cool thing with the particle system is that I can also use a fade in and a fade out in the color of Lifetime and then all I had to do was adjust this by scaling this up since I was using hierarchy scaling mode and adjust this to the fall maybe decrease a little bit the Distortion amount basically this gives a lot of options to control the reples and it creates a really nice effect now to fake the for what I did was adding an erosion parameter to the waterfall Shader which is basically a vector one a slider between zero and one and I connected this to a one minus note and to the alpha input of the UN Master but for this to work out I have to connect the output of this node from the vono and the ramp to the alpha clip threshold I had to invert this with a Y minus note and that's exactly what I wanted to create the form now with this I was able to duplicate the waterfall particle system push it just a little bit to the front and duplicate this material which I could have used at custom vertex streams I have videos about that by the way but anyway I assigned this material to the foam particle system and now I could erot this and increase or decrease the bottom strength or for example play with the ripples amount to have more or less foam and I also increased the intensity of the color and then made a few more adjustments and when everything was played together I got this nice looking foam it's a pretty cool way to fake the foam in a stylized way now for the rest like the splashes these ones I used the blood Shader from this tutorial that I made which I left the link description if you are interested it's quite useful and I just made it blue I'm using even the same text from that tutorial and I also use it for these splashes but this time I use the reples texture then there is the foam which I actually prefer the one that I made for this tutorial and then there's also this particles which are super simple to do if you want to learn more about particle systems by the way I have Udi course that may help you to learn more about particle system but this is really simple it's just some stretched particles they are using gravity as well and then just a few more round particles and now one last thing that I did for this tutorial is create some ripples with the waterfall Shader basically all we got to do is duplicate this foam but instead of using the water fo mesh you can replace it with the reples mesh and we end up with this all I did was rotate this horizontally and made sure it had no vertex of set amount I increased the size just like this and decrease the bottom brightness rotate it nicely scale it a little bit more had a little bit more of erosion and that's it it actually adds a really nice touch and it's something that is super easy to do with what I have shown already in this tutorial and basically if you recreate the blood Shader and create some particles this is the result you can get it's pretty straightforward and and this is just another example of how awesome shadow graph can be you can create some really cool stuff there's a lot of ways of going about this but I really enjoyed this waterfall for this specific scene for this style I think it looks really cool so that's it guys I hope you have enjoyed this video this project is Ava my patreon page the links in description you'll get everything I use it here and you'll also have access to many more effects and shaders that I've have shown on this channel and I will appreciate a lot your support I want to say thank you to every Patron that supports me these videos would be a lot harder to make if I didn't have your support and I want to say a special thank you to the super mega patrons which are AI Yen Alejandro David maidenberg for erog games.com Goblin plag James Finley R andola Mark bream remel Travis mcum Warden Studios ravier and Guan andoni you guys are amazing and I really appreciate your support so thanks everyone for watching this video I hope you have enjoyed and I hope to see you in the next one as well
Info
Channel: Gabriel Aguiar Prod.
Views: 153,334
Rating: undefined out of 5
Keywords: Unity tutorial, unity effects, game effects, unity particle tutorial, unity game effect, unity shader graph tutorial, unity shader graph, shader graph, shader graph tutorial, unity shader tutorial, unity shader, unity particle effects, unity shield, unity, unity waterfall, unity waterfall tutorial, unity waterfall shader, unity cascade, shader graph water, shader graph waterfall, waterfall, unity shader graph waterfall, unity water tutorial, unity water shader, unity ripple
Id: yJ0NRr-DdYU
Channel Id: undefined
Length: 23min 5sec (1385 seconds)
Published: Thu Nov 07 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.