Making a simple water shader in Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello we're just going to go over and show uh how to make this water surface FX here uh this just a shading material as to put on a mesh so we're just going to go ahead and do that and show how easy it is to recreate this this is within Unity if you don't already know so far so first we're just going to go ahead and move the mesh first let's move that out the way as you can see here it's just another little plane there so we're just going to go ahead and create in our object in our scene here is creating a plane we going to move this up and we're going to zero it positions just so that it lines nicely over our pool of water um our current plane has no mesh sorry no materials and this is all done live so let's go ahead and create that texture so inside my custom asset folder we're going to be creating a uh first a Shader that's going to be a Shader graph urp that Shader graph we going to call this uh water surface Shader um you know whatever name of convention you uh have to follow or as it implemented you'll have to follow that for here it's just a personal project so for the water surface Shader you'll create a material for it as well so go the create go over to the materials it's right here call it uh water surface Shader I'll call it the same name just to keep my life easier uh within the water surface Shader you're going to want to change the Shader to uh the Shader graph and choose the one you just made so water Sur Shader so now the two are linked to each other the material has the Shader so now we're going to go into the Shader itself and then this is where all the magic happens right so now we're inside the uh water surface Shader that I just made and we're going to go change the uh the surface type to transparent and then we're going to turn off cash shadows and receive shadows and that should be I believe that should be it for that yeah that should be it and then we're going to move over here and then I'm going to go ahead and create um uh a texture node so create node you'll look up normal from texture right I'll duplicate this because we're going to go ahead and uh we're going to combine two different textures together to create an interesting uh an interesting look and I already have some textures already pre-loaded into the project I'm sure that if you find your own you can create your own um textures and experiment with that so we're just going to ahead and go with gamer 11 cabore and go cabor 12 sure whatever course there it is okay cool so that's just the basic six of it obviously um to combine these two together you'll use a uh another another node which is I believe texture combine uh what was it called again was it combin oh no not that one not that one was it called again I don't forgot uh uh I think it was blend let's try this one blend normal Blends yeah there okay take this there and then the second one should go here and you can see them overlay on top of each other perfect now do the output should be connected to the normal tangent over here and you'll see that our mesh preview is now updated with said um uh changes so we're going go ahead click on Save asset go back to our scene oh right I forgot to apply this apply the material to the uh mesh and you see that's an ugly gray blob we're going to go back to the uh water surface Shader that we just created and then we're going to make it not look so terrible oh uh to give it the first off we're going to make this smooth into like one so first off it's look a little more smoother and then we're going to make sure that it's going to be see through so we turn off the alpha to zero that should make it a little more water like click on the scene there you go now you can start see there but uh obviously not moving so we want to replicate this one so go back to the one we just made and then right now we need normals so some normals oh oops normal think a normal Vector let normal blend I forgot no no nor blend uh no called oh I'm silly it is tying I'm sure it's called tiling we got now do the tiling off Set uh unreal has this as well sort of same thing deploy this one over here all right cool now we get to hook up the uh tiling offset to our textures here right so now we can just see some changes and then we want to make sure that uh it is changing over time and to do over time we can use I'm using polyal time you can use your own uh the normal one that comes with the engine this is be this is perfect for my my purposes and I'm going to do a multiply node so so now that I have my time when I multiply so I can control this time and then we're going to plug it into the offset right and you see right now the I don't have to do anything and it's just like going it's just going ham going duplicate this here and the second one we just put to the offset and they're both moving in the same direction and this is kind of the final output if I was to save it now and show you guys what it looks like out here this is the water surface uh kind of looking crazy so we're just going to go ahead and slow it down um1 uh it's about this slow yeah and then this one I want to go a different direction so we're going to do the same speed but let's do .1 okay so they're like crisscrossing each other you see that there's a nice effect going on right there so we're going to save it go back to our scene and check it out yeah just a quick short tutorial of how to create a water surface uh material uh that you can apply to your mesh cool
Info
Channel: BunnyDevCorner
Views: 55
Rating: undefined out of 5
Keywords:
Id: VgFkFZZUCbA
Channel Id: undefined
Length: 7min 8sec (428 seconds)
Published: Mon May 13 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.