Creating a 2D Water Shader in Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
have you ever wondered how games make their water look like this I'm going to show you how it's not as hard as you think first of all you want to create a new project with unity and make sure that you're using the universal render pipeline so select this option here and then create project then we're just going to do a little bit of setup all you need to do is create a new 2D object Sprites and then select square and then just make that as big as you want I'm just going to set the scale to five and then in our folder we're going to create a new Shader graph Universal render pipeline lit Shader graph I'm going to call that water graph then we're going to create a material from that graph we'll call that Shader water material and then you're going to click your square and you're going to drag that material into the material slot of the Sprite renderer then you're going to double click your water graph and you're going to see this is your Shader graph here so first of all in the graph settings you can make sure your material is lit surface type is transparent and then we're going to create a new color call That Base color select a nice blue kind of dark blue drag that in and hook that up to the base color then we're going to create a new node I'm going to search for voronoy and this is how we're going to create the ripples we're going to add a time node and we're going to multiply that so you're going to drag the time into a and then that out into the angle offset and that will move the ripples you can change this B value and that will change how fast the ripples move now we're going to move these across a bit and we're going to create a power node we're going to hook the output of the voroni up to that and this B value here is going to change how thin the ripples look I'm just going to select two and then we're going to multiply this power output with another color which we will select as a light blue and that'll give the ripples a color I'm just going to make this slightly lighter and then all we need to do just move these a lot across slightly all we need to do now is ADD our base color to the output here of our ripples and then select the output of the ad into the base color here and then if we save our asset and go back to the scene we can see we've got it here and now we can play the game and we can see it's working hopefully you found that useful follow me for more
Info
Channel: Pistol Shrimp Games
Views: 688
Rating: undefined out of 5
Keywords:
Id: bJUnVU7eECc
Channel Id: undefined
Length: 3min 19sec (199 seconds)
Published: Sun Sep 03 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.