First off, great tutorial. This was my very first introduction to Shader Graph, and I'm loving it. Thank you. Second, for anyone curious, apply the scene depth cluster to the alpha channel, instead of the emissions channel. This will create a beautiful alpha transition for the water and any objects in or under it will still show the object textures/color. it will also cause a wonderful water-murky look the deeper the object moves from the surface. Obviously this is a bit more involved than I lead on, but hopefully will help someone.
Can you please provide another tip? I applied the clamp to the alpha instead of the emission and pretty much the water turns invisible. Maybe I misunderstood.
Making such shader is freaking rocket science. This one is probably more sophisticated than the game I'm creating lol. That being said, thanks for putting the effort in making this tutorial, because now I have an amazing water tile (repeatable!!) which I couldn't find in asset store. Also hi-five to you commenters, because you solved a couple of problems that were encountered!
For whoever is having issues with the specular parts on the 2019.3 version, mouse over the "PBR Master" node and click the cogwell for the options, then change the "Surface" type from "Opaque" to "Transparent". Also, on the Clamp, increase the maximum value so that it doesn't get obfuscated by your scene's lights.
I found that on the camera object, clicking "Post Processing" (may be "Enable Post Processing" for some) is what finally got this shader to work for me. The problem it gave me occurred only after we upgraded to Universal Rendering Pipeline. The shader would only use the "scene view" to render the depth properties - it was absolutely bizarre. If you find yourself facing something similar, try enabling the property I said above.
For those having problems with the foam what fixed it for me was lowering all the inputs of the shader to values between 0 and 2, that way i could make the foam work in Unity 2019.4.1 Thanks for the tutorial, i really learned a lot
This is incredible for someone like me who does not know 3D Math and 3D Graphics well. These effects look realistic so fast and with just one effect of adding normals. The waves look amazing. It is quite hard to understand what's going on though. I neeeded to search for answers a lot.
At first i couldn't achieve the same result as the video, for everyone using LWRP on Unity 2019.3.3f1 i had to set on the shadergraph's master node from opaque to trasparent, on the LWRP asset check the box "Depth Texture" and try to play a little with foam distance and strenght. Anyway bigup for the tutorial, it helped a lot
Thanks for the tutorial! I also faced the problem with a foam. The decision helped me was to reduce the plane. The texture I used stretched to the full plane, and there was a black part next to the object, so nothing was visible. Reducing the plane by 3-4 times saved the situation.
I have fixed the foam problem! I changed the settings of the LightWeightRenderPipeline -> General -> Depth Texture (check this). After I checked it, in Game Mode, everything was back to normal. Yay
I had that checked off way before this tutorial and I wound up with the same issues as everyone else. If you Did fix the issue in your scene, then you must have done something different than what's in this tutorial. Anything over or in the water winds up with a glowing outline that seems to draw on top of the water plane.
@@danielvast2007 Yeah I checked it out quickly last night and had the same issue, it works on completely flat water but unfortunately LWRP still draws the depth before the vertex offsets, so if you have any wave hieght at all it gets a bit wonky. I have a feeling this is a permanent restriction for going with LWRP, which makes sense as the entire point of using the light weight pipeline is to keep things light weight!
Hey man, great tutorial. I managed to get an excellent result following your instructions. I have only one thing that I would like to improve: the foam. Your system actually shows the foam only inside the object visibility under the water level. But in real world foam spreads around the object more like a ring on the surface, floating outside the object itself. I hope I made myself clear enough. Do you think such thing is achievable somehow, like blurring the edges of visibility for example? Thanks in advance.
Hey, yeah I know what you mean. We're using the scene depth to basically find out where geometry intersects with our plane, and thus any effect we use with it will correspond to the depth, so larger "sea foam" = deeper. This is indeed technically incorrect, but it's the way a lot of games do it. As far as I know, we can't use this information to affect only the surface of our object, since it is not looking at surface information at all. You can add general sea foam to your water, and have it appear more in areas like the heights of the waves, I have tried using this same logic in conjunction with the depth node, but it just does not work.
@@PolyToots Thanks a lot for your feedback. Basically here is what I'm doing: i.imgur.com/NUqIDzV.jpg A scene with animated sea animals. The foam of the animals doesn't look convincing with this technique. I'll see if I can tweak your material somehow, but in case you have any other suggestions, I'd greatly appreciate.
actually 28:22 there's no need to multiply Linear01 scene depth by cam's far plane. change the sampling Mode of Scene Depth to Eye will do the same thing
I do love your tutorials but I do have a constructive criticism if you'll indulge me. My only recommendation would be to slow way down during each step so we can see what you're clicking on (for example when making the very first pbr shader), it was extremely hard to see what you clicked without pausing at just the right moment during a few moments in the video. Overall though, I'm extremely grateful for you taking the time to make this and share your knowledge. Thank you, definitely getting another thumbs up!
This was happening for me as well because my plane was set to opaque instead of transparent (surface setting in the master node in the shader graph). Might want to check if that is also your problem
You're incredible dude, keep it up! I managed to adapt this with Gerstner waves to get something even more realistic. Do you have the foam texture though, I can't seem to find any good ones?
I think that foam texture has been lost to the ages, sorry man. It wasn't actually that good though, so don't worry. Just find something messy on google and make it tile.
Thank! I really like the tutorial, not only because of the water shader, but the way you explain everything you do to create the effect is really cool. One question, Is there a setting to be able to visualize the animation of the shader in real time, when I was working on it I had to play the scene in order to be able to see the effect or select the camera in the Hierarchy panel and see the shader in the Camera Previe. Thanks!!
Yeah there's a little button at the top menu of the "scene" view, it's one of those icons that has a little triangle to indicate more icons of you click on it. One of the options is for animated materials. You must have turned it off at some point because I'm pretty sure it's on by default.
I dont get how yours looks so 3d before any waves, just adding the normals made yours look so good. Even using the same normals mine just looks off when closer to it. How do you setup the normal imag?
Thank you so much for the tutorial. It looks so great with HDRP. For the people who dont have the emission, try adding an emission node in between the clamp and the emission slot of the pbr master. Then set the intensity unit to EV100. An intensity value of 15 worked for me. Also if the water moves with the camera change the first position node (before spliting and combining to RG) from world to absolute world. That should fix it. I also tried to make the waves from this straight line to a more curved line but did't succeeded yet. Does anyone know to do that? I tried messing with the UVs with a rotate and radial shear node but it did't work for me. Maybe someone knows how to do it.
Yeah trying to bend out the noise so they are "curved" instead of straight is going to be tricky. An interesting approach though, stretch them so they're straight, and then try to warp them. You'd probably be better off just starting with the right shape to begin with, instead of trying to fudge a noise node to do it. I think I'll get crackin' on a new water shader soon, this time with proper displacement. Maybe it will help.
Can you show how this would look at 17:47? For some reason when I modify wavetile and wavescale at that point it just doesn't do anything, I think due to the lack of emission when he's testing it.
Hey @Simon +Simon that's fantastic to hear, mine is looking oatmeal-colored for some reason. I'm 6 minutes in and it looks nothing like it does in the tutorial. Did you come across a similar issue by any chance? :(
Very cool, very informative and easy to understand ) thank you . What you think about book page curl in 3d mesh? How we can do it? Need it for vr quest i am making now at my company. Anyway good luck wait your unity tutorials very often
@@PolyToots, maybe just pressed button on controller. But I need it to be done not only straith fliping. But with some curve-like style, like in real life) thanks you. Sry for my bad English
I've made a very simple page flip in the past, do you mean something like this: i.imgur.com/icRtKiK.gifv ? If so, I didn't use unity to make it, just a basic model and rig in 3ds max.
Great tutorial, just learning Shader Graph and you do a great job of breaking down how/why we're using each piece. The effect looks fairly similar in my version until I got to the Foam part. Maybe because I'm using LWRP or something but the foam is everywhere in the scene view and then doesn't show up in the game view. Guess I can live without foam for now. Oh also, it'd be really useful if you sort of panned through the whole Shadergraph at the end so that we can easily check for any mistakes or missed nodes.
I am having the same problem. I get a very strange "halo" effect of whatever is intersecting with my water plane. I took the exact same shader and dropped it into a HDR project and it looks identical to the PolyToots' example. i.imgur.com/FJnVzrA.png If you figure it out, let me know!
I ran into problems as well here. What worked for me is to set the depth node to Eye space and remove the camera node, then link this to the A slot of the subtract node. Another thing you can do is replace the clamp with the smoothstep node to get a smoother transition (works very well for the object depth) though control is a little more limited from what I'm experiencing Also: Remember to set the PBR node to transparent, forgot this and nothing seemed to work and caused a major headache hahaha
FOR ANYONE WHO WAS HAVING ISSUES NOT SEEING FOAM. THE ISSUE IS IN YOUR LIGHTING/SCENE RENDERING AND POST PROCESSING SETTINGS. IF YOU LEFT ALL THE SETTINGS AT DEFAULTS IT CAUSES THE FOAM TO NOT BE THERE. if you go into post processing volume settings and disable EXPOSURE then go to your volume settings to your sky settings and also disable EXPOSURE . then go to your directional light settings and change the lux from 100000 to 10, this will fix your issue
[Shader Graph version 10.3.1 with URP in Unity 2020.2.7f1] I didn't see foam in my example but it is fixed when I set as foam distance < 1. This one cost me one hour of research but I learnt lots of things. If you are using previous version of Shader Graph you can also check ZWrite in generated shader code and if it is "Off" then set to "On". (This issue has been fixed in some version of shader graph but don't know which one)
Awesome tutorial, two things that may help someone else. In URP object in general select the depth texture, without it in play mode the shader doesn't work. And I could find the foam texture that is used in the tutorial.
Would this work with rigidbodies? I notice the wave is moving, but not the object. I am looking to create a water system for a game but I have never done water before. I was thinking of using this as a base inspiration to show me how it could be done. But before I go through the whole thing, I'd like to know.
Great tutorial! One problem i ran into is that the foam doesn't seem to work on an object with one of my own pbr shaders. Any idea what i'm missing? EDIT: It doesn't work on objects with textures set to transparent apparently, leaving it here in case someone else has the same issue.
Scene depth is 0 to 1 depending on the depth. If you multiply that with the camera far plane you get the distance from camera to the point in the scene. Shadow calculations in the 90s leveraged that alot. Now you take the screen position raw to get the distance camera to your other object, because your water is "transparent". It will be ignored here. You move the distance nearer to the camera with a subtract. That is equivalent in moving all objects nearer to the camera in regards of depth. Now you subtract water distance with the none transparent moved distance. Everytime this is minus you have objects out of the water but closer to camera caused you moved them. One minus does the trick here and clamp fixes values below 0. That is how the projection works IMHO
@@PolyToots Another tip of mine: look at ruclips.net/video/jBmBb-je4Lg/видео.html he solves it differently. Sorry if you don't want me to link other channels (this is not my channel). Tell me will remove the comment.
Yeah I think I've seen this before, I'll have to have another look. No worries about linking other channels, we're all here for knowledge, doesn't matter where it comes from.
If I may ask, where did you get your ocean normal map? I tried to use the one from the tutorial with Amplify Shader, but maybe I converted it in Unity wrong or something? No matter what I do I cannot get my water to look like yours, or be as shiny/detailed. At first it looked extremely flat, I messed with settings to get it okay, but other normal maps worked better. It still looks nowhere near as good as yours though, is there any trick to importing a normal map for this?
I've had that greyscale map for so long that I can't remember if it was one I made or just grabbed from google. But, to hopefully fix your issues, here's my conversion settings: Bumpiness: 0.1 Filtering: Smooth Then on the shader/material itself, I bring the normal map strength down to about 0.25. Oh, and my smoothness value is about 0.8. you'll definitely need smoothness otherwise the normal map will look flat.
@@PolyToots Hey, kind of late to the game, but I've followed these steps and I seem to be getting this strange streaky mapping effect, almost as if the map's only being repeated on one axis and stretch all along the other, I've taken a screenshot of what im talking about here: pasteboard.co/Iwo1JaA.png If anyone has any suggestions they would be an absolute life-saver!
Always better to be safe than sorry and order your coefficients correctly when doing multiplication, right? I thought I was bad at math but holy hell I'm honestly impressed how much is possible nowadays with absolutely zero understanding of basic grade school math principles. That statement blew my mind.
I don't know what statement you're referring to, but in the future if you've got a point to make it wouldn't kill you to be nice out about it. Maybe you see something wrong in peoples videos and can help?. Because you're right, I am not good at math, never was, and I am amazed at the things I can do when I keep trying, it makes me happy. Don't try to take that away from people.
Been experimenting with this... Why not in the last step take a Scene Color node rather than a Color node? You can even distort the UVs on that, if you want. If you then modulate the amount of distortion with your screen depth construct, you can make relatively convincing light scatter...
SOLVED - Guys I am also faced with a foam problem with both 2019.4 and 2020.1 versions. I have tried all possible solutions mentioned in other comments bu couldn't make it happen. Then I changed the max values of 'Clamp' which connects to the emission, so foams are appeared. Just set max values to 100 (x, y, z).
Any thoughts on why it is that @ 17:49, when you adjust the wave scale, it changes but when I do it nothing happens? I tried adjusting the Vector 2 values, as well as the wave tile value, just in case my water tiles were way different that yours but I'm still coming up short. imgur.com/a/mgYCvMs (Unity 2019.1.14f1)
Hellow, PolyToots! Greate lessons! Can you help with one problem? When i try to apply your shader to sphere - seams appear. I think this is because you are using the World coordinates. Is it posible to fix it? I want to create a ball of water) Thanks.
You could try just using a regular UV node, though I think the default unity sphere will still have a seam. Another option is to use triplanar node instead.
Idk why, but I am using unity 2019.3 with HDRP and the foam doesn’t work for me even when I set the water to static or not, and I tried both pbr and lit shaders but nothing. It just doesn’t show up
Hey man, I was wondering if there is a fix for the material looking really bad when viewed from directly above. Is this because it is just a normal map and not an actual mesh, or did I do something else wrong?
Really love the tutorial so far. 14:53 in the video and will finish rest tomorrow. Understanding everything. I found using Sub Graphs makes everything cleaner and easier to read. I have one for the color and one for the normal tiling logic. If Its possible where can I find the Normal Map your using. The one I'm using is not so good. Smoothness looks really weird. I'm using Universal Render Pipeline(Formerly LightWeight) in the current 2019.3 Beta
Ah I really need to update the description of this! Sure, the normal map I use is this greyscale image (you'll need to convert it to a normal map in unity inspector) www.dropbox.com/s/hb5ror23d0hphef/WaterBump.jpg?dl=0 I use the "smooth" option and use a low value for strength.
Hey! Sorry for my English! Is it okay if my plane is pink from the beginning ? I follow everything like on the video but can not understand why my material does not change a color :( Should i continue and it will change later? Sorry for my question if it too simple ... im beginner of Unity :D
Hello, no that's probably not good at all! Pink usually means a missing reference, in this case I would assume that what you're missing is probably the correct rendering pipeline. This is a bit complicated nowadays, especially for beginners. But basically you need to decide between "HDRP" or "URP" rendering pipeline, and then you would install ShaderGraph from the "Package Manager" (though it usually comes installed by default now)
Great tutorials video! But can you help me with one thing, please? I'm just a beginner so please don't mind me with little problems. So when I right-clicked to the PBR Graph, clicked create, then added material. Why did my material turn into pink?? I searched up and look at every video, but it didn't quite help me. So if you know please help me. By the way, the rest of your video is great... I LIKE IT.
Yeah so you'll need to install a render pipeline too, as at the moment shader graph is not compatible with default unity rendering. There should be loads of tutorials about how to do this though, maybe try searching for something like: "unity how to install render pipeline" or "installing LWRP or HDRP"
Thanks for the tutorial.. the scene depth is driving me nuts in lwrp though.. Audio?. Knowledgeable?. Yes, I am. I'd suggest a Blue microphone or simple usb equivalent. Make it easy on yourself.. Or you could get a little behringer usb 2 channel input box with phantom power and preamp for about 20-30 bucks U.S. Then, you can use a phantom powered condenser mic of your choice and you'd have a preamp to boost your signal.. ART makes an affordable preamp / limiter that sounds pretty good if you really need the extra overhead for recording anything more dynamic than video narration. Get a unidirectional mic. Think about the angle of reflections. Don't back yourself into a corner or against a wall when recording. If you do, pad the wall behind you.. Thanks again. This shader looks really good in my scene. :)
Thank you for the tutorial. Just have to wait for them to fix the bug for URP so that the foam texture applies to the foam regions. Right now it's just solid white. I tried the methods in the forum link posted but no luck :/
Hello! Is there a way to draw foam on the sides of the object? cos no foam is drawn because the shader does not detect an object close to the surface. Thank u!
The issue with using the Scene depth for the foam mask is that if you place a cube in the water and you look from above, you will se no foam (to see this, place a cylinder, cube or capsule at 0,0,0, not rotated. Place the camera just above looking down). I hope unity will give us distance fields so that we can get a better solution.
How the hell are you cloning the planes and having them snap on borders? I've been googling for 30 minutes and haven't found anything that works like what you've shown.
Sorry! I know how that feels too, I'm thinking I should get one of those hotkey-visualiser thingies. Anyway, the trick here is not that it's necessarily snapping to the bounds, It's just that I'm moving it by holding down the left "Ctrl" button, which moves objects by increments of 0.25. Oh, and duplicating with Ctrl + D if you didn't know that yet. Sometimes this doesn't always work though, original starting transforms and of course an objects scale will effect the result. Default planes just happen to be 10 units big, so it's a nice easy number to reach. If you want to snap objects together that are not following any sort of logical grid, you can hold the "V" key down with an object selected, the cursor will change slightly, and you can grab a vertex point from the mesh, and move the entire mesh to another objects vertex point.
I used some features from this tutorial and added them to another shader graph and it's working beautifully in HDRP. Only problem is that there is a lot of banding due to the noise and fresnel for the vertex displacement for the waves. How can I avoid the red color bands in the water?
Hey! Thanks for that tutroial. I have just one question: In the Scene View it looks great(just the bug of the foam) but when I am going in the Game Scene it will turn pink. Do you know why?
I see no texture at 3:50, just nodes. The only time I put a texture in is between 6:20 and 6:25 (it is extremely fast to be fair). Are you talking about the texture property in shader graph? At the time you mention, I put down a Sample Texture 2D node, this is recorded and I can see it in the video, and then at about 4:01 I create a Texture2D property, which I rename to "Normals", and then drag it into the view and hook it up, again this is all recorded and I can see that it's happening.
Because I still have no idea what your original question was, the only dragging of anything related to a 2D texture I did was at about 4:01 where I dragged the empty property from the blackboard, and hooked it into the Sample Texture 2D. I'm not trying to have a go here, I genuinely want to understand you because if there's a problem then I can avoid in the future but If I didn't do something you think I did and that is what confused you, then there's not much I can do about that, since I did not do it. Still though, best of luck with your shader journeys.
Not sure if someone asked before but, how would you use for example a displacement map for the vertex displacement instead of the simple noise you´re using? Because even importing a higher density plane the simple noise just doesn´t give me the effect I´m looking for
You can use whatever you want in place of the noise, that only dictates how the water moves, so if you plug something completely different in its place, you'll get a different result. I'm assuming what you want is maybe more along the lines of a "Gerstner" wave, so have a look for that. One commentor on this video: ruclips.net/video/DtycHSpDhXY/видео.html (check the pinned comment) has supplied his own version of these waves with shader graph.
This video is perfect to me to work on my small project. I have a quick question about it. How do you make the water transparent? After I made it as a transparent, and whenever I moved my camera angle, it was disappeared :(
What should I do if my water doesn't look like yours at all? I have a very strange one. Perhaps this is due to a different version of Unity where the Shader Graph was changed. My water is not properly reflected and seems to mix. If possible, could you update your tutorial to the latest version of Unity and Shader Graph?
@@4ghzgaming664 You can try adding an emission node before connecting the clamp to the emission slot of the master node. Then try out the values for the intensity with the intensity unit set to EV100. 15 worked good for me.
I love the Hybrid branded audio Interfaces they really cancel out noise and look pretty cool lol I also recommend using some kinda of sound absorbers to eliminate the roomy sound
Cheers Nala (again), I will look into Hybrid for sure. Sound absorbers might not be feasible in my flat, but I'll see what's available and keep it in mind for the future. Thanks again!
If you're facing an issue where the foam covers the entire surface of the water try setting the surface type to transparent in the graph settings, that's what worked for me
Because of a missing PBR Shader in this version I'm using the [HDRP -> Lit Shader Graph] insteed. The part with the waves seems not to work with HDRP in Unity 2020.2. Tried it also with the recommendation of [Simple Noise][Out] -> [Emission Node][Color] and Emission of the Main [Fragment][Emission]. Changed also the Intensity Unit to EV100, played with Intensity and Exposure Weight values. Nothing helped me..
Hi, I'm having a little trouble with the normal map, It seems a little bit "Flat" compared to what is shown in the video, is there something that I could be doing wrong?
Go into the Texture folder in Assets where you placed the downloaded Normal image. Select it. Change the Texture type to Normal Map : Shape 2d and Check Create from Greyscale.
About the only way to perform UV offset, why don't just just add a vector2 to your actual world UV (using time * vector2)? I always used a add and multiply on ASE to perform tiling and offset, and I'm pretty sure the Tiling and Offset nodes are doing that behind.
PolyToots, amazing tutorial, it helped me a lot! But I'm running into an issue: I apply this shader to my plane, then duplicate this plane to create my ocean. In the editor, it is fine but once exported in-game, the ocean is misplaced (way too higher on the Y axis than in the editor), also the planes are culled too soon, they disapear while mid screen. If I apply a basic material to the planes, it doesn't happen any more. Any idea on what is going on?
That sounds pretty weird. What unity and shadergraph versions are you running? I've had people report depth issues on LWRP, but nothing like what you're describing unfortunately.
@@PolyToots I'm on Unity 2018.3.12f1, as for Shadergraph I can't tell, but that's the vanilla version. I'm also using HDRP. Here is a link to an .unitypackage file with my shader and the plane I'm using to make the ocean: mega.nz/#!dvxHRAYY!U1tHY6HQFnwVPid5KzjE5gG3qZMQczKVmZv5QkDm7VA
I have a question about the world coordinate tiling method. Is there any way to make that work in three dimensions? Seems whatever I try, I can only get it to work in a single plane per shader, can't even tilt it... I feel like I need to do some math using the normals to determine what plain I am in, but...
What you're looking for is a "triplanar" shader. I have a tutorial for it with shader graph, but I think both shader graph and amplify have a triplanar node. The downside of using a node is you can only hook in one texture (I believe). The tutorial on my channel shows how to make your own, that way you can hook up to 3 textures in. Like if you wanted grass to always be on top for example.
@@PolyToots I looked into triplanars, and they are indeed incredibly useful to map all of world space onto UVs. Sure beats doing the math by hand with the normal vector etc... I found I can even do a directional mapping this way, which has really allowed me to give this effect some serious depth while still flowing down a slope.
I had a similar problem, my fix was convoluted though. I set the lighting under project settings to Linear and it suddenly worked. However, I lost the lovely sparkle that the water had. I'd love to get that back if anyone has any ideas.
Has anyone found the fix? I too have followed everything verbatim up until the foam and I can't seem to see the foam emission at all regardless of toggling a bunch of different values at this point. I tried setting my objects to static to see if that would make any difference. I'll try the linear lighting route and see if I can find a fix by experimenting with those options. I'm using version 2019.2.5f1 with HDRP. Not sure if that makes a difference.
Thanks a lot for posting this tutorial! One issue I've come across is in HDRP, using the TAA (anti-aliasing) in the Camera settings creates a ghostly effect whenever another object moves in front of the water (such as a character). If anybody finds a solution to this, would be highly appreciated!
My PBR master has Vertex Position, Vertex Normal and Vertex Tangent. If I plug the Vector3 from the wave strength into Vertex Position... it just kind of makes the whole plane move up and down with only minimal "waves" - hardly look like waves at all. Its not to do with wave strength - I increased that and still hardly any definition between waves.
Tried on URP 2019.3 and everything except the foam works fine and awesome. PS: I have already tried everything that any of the comment states so if anyone knows how the foam thing can be solved in URP then please let me know, much-needed help. Awesome tutorial by the way.
Thanks for the tutorial, however I followed it almost perfectly and still have a issue, seems the water is moving with the camera, it's making me motion sick lol, Any tips? ty.
You're not the first to have this issue, but I checked recently on mine and all was well. I would pay special attention to everything going into your emission slot, things like the Camera node using the Far Plane, and Scene Depth being set to Raw, and of course make sure the connections themselves make sense and you're not hooking things into the wrong multiply's or anything.
@PolyToots I honestly checked over and over again and everything is exactly as it should be not sure what I'm doing wrong. I even went that extra mile to keep the whole thing looking like whats on your screen.
@@PrincessSleepyTV I had this problem too. You can try changing the first position node(before the split and combine to RG) from world to absolute world. This worked for me😊
@@PolyToots Maybe a stencil cutout with gradient masks? Hmmm, not sure. I did a single object cutout recently, but I doubt it would be performant considering "arbitrary"
At first thank you very much for the awesome tutorial, and second could you share with us the normal map you used for the ocean water please. will be grateful.
Sure thing, it's a grey scale map so you'll need to convert it to a normal map in unity. Make sure the settings are not too strong when you do it: imgur.com/4bgAedW
I mostly do all reflections these days either with reflection probes (which I believe are supported by default) or a screen based post processing effect. So on the shader side there's not much I do with reflections, unless it's like old-school forced cube mapping onto the material itself.
First off, great tutorial. This was my very first introduction to Shader Graph, and I'm loving it. Thank you.
Second, for anyone curious, apply the scene depth cluster to the alpha channel, instead of the emissions channel. This will create a beautiful alpha transition for the water and any objects in or under it will still show the object textures/color. it will also cause a wonderful water-murky look the deeper the object moves from the surface. Obviously this is a bit more involved than I lead on, but hopefully will help someone.
I guess with this you're trading the edge foam for crystal clear transitions? Sounds like some good tips though, thanks for commenting!
Can you please provide another tip? I applied the clamp to the alpha instead of the emission and pretty much the water turns invisible. Maybe I misunderstood.
Making such shader is freaking rocket science. This one is probably more sophisticated than the game I'm creating lol.
That being said, thanks for putting the effort in making this tutorial, because now I have an amazing water tile (repeatable!!) which I couldn't find in asset store.
Also hi-five to you commenters, because you solved a couple of problems that were encountered!
For whoever is having issues with the specular parts on the 2019.3 version, mouse over the "PBR Master" node and click the cogwell for the options, then change the "Surface" type from "Opaque" to "Transparent". Also, on the Clamp, increase the maximum value so that it doesn't get obfuscated by your scene's lights.
Thanks man
I found that on the camera object, clicking "Post Processing" (may be "Enable Post Processing" for some) is what finally got this shader to work for me.
The problem it gave me occurred only after we upgraded to Universal Rendering Pipeline. The shader would only use the "scene view" to render the depth properties - it was absolutely bizarre. If you find yourself facing something similar, try enabling the property I said above.
.😁
For those having problems with the foam what fixed it for me was lowering all the inputs of the shader to values between 0 and 2, that way i could make the foam work in Unity 2019.4.1 Thanks for the tutorial, i really learned a lot
This is incredible for someone like me who does not know 3D Math and 3D Graphics well. These effects look realistic so fast and with just one effect of adding normals. The waves look amazing. It is quite hard to understand what's going on though. I neeeded to search for answers a lot.
I like the way your voice is. Its clear, Magic and travel with me in my knowledge journey
Thank you very much!
At first i couldn't achieve the same result as the video, for everyone using LWRP on Unity 2019.3.3f1 i had to set on the shadergraph's master node from opaque to trasparent, on the LWRP asset check the box "Depth Texture" and try to play a little with foam distance and strenght. Anyway bigup for the tutorial, it helped a lot
is this shader going to work with URP projects? btw great tutorial!
Thanks for the tutorial! I also faced the problem with a foam. The decision helped me was to reduce the plane. The texture I used stretched to the full plane, and there was a black part next to the object, so nothing was visible. Reducing the plane by 3-4 times saved the situation.
A very cool tutorial, I edited & fixed some issues with the recent versions of HDRP but that helped me a lot to understand how it work !
I have fixed the foam problem! I changed the settings of the LightWeightRenderPipeline -> General -> Depth Texture (check this). After I checked it, in Game Mode, everything was back to normal. Yay
Ah of course, makes sense that LWRP would have depth disabled. Thanks for discovering it though! I've only recently switched to LWRP myself.
I had that checked off way before this tutorial and I wound up with the same issues as everyone else. If you Did fix the issue in your scene, then you must have done something different than what's in this tutorial. Anything over or in the water winds up with a glowing outline that seems to draw on top of the water plane.
@@danielvast2007 Yeah I checked it out quickly last night and had the same issue, it works on completely flat water but unfortunately LWRP still draws the depth before the vertex offsets, so if you have any wave hieght at all it gets a bit wonky. I have a feeling this is a permanent restriction for going with LWRP, which makes sense as the entire point of using the light weight pipeline is to keep things light weight!
Mine was still broken with Depth Texture on, but was fixed when I turned both that and Opaque Texture on
@@kay12755 ah my opaque was standard checked, guess both have to be checked then. But glad you found the solution :)
Hey man, great tutorial. I managed to get an excellent result following your instructions. I have only one thing that I would like to improve: the foam. Your system actually shows the foam only inside the object visibility under the water level. But in real world foam spreads around the object more like a ring on the surface, floating outside the object itself. I hope I made myself clear enough. Do you think such thing is achievable somehow, like blurring the edges of visibility for example? Thanks in advance.
Hey, yeah I know what you mean. We're using the scene depth to basically find out where geometry intersects with our plane, and thus any effect we use with it will correspond to the depth, so larger "sea foam" = deeper. This is indeed technically incorrect, but it's the way a lot of games do it.
As far as I know, we can't use this information to affect only the surface of our object, since it is not looking at surface information at all. You can add general sea foam to your water, and have it appear more in areas like the heights of the waves, I have tried using this same logic in conjunction with the depth node, but it just does not work.
@@PolyToots Thanks a lot for your feedback. Basically here is what I'm doing: i.imgur.com/NUqIDzV.jpg A scene with animated sea animals. The foam of the animals doesn't look convincing with this technique. I'll see if I can tweak your material somehow, but in case you have any other suggestions, I'd greatly appreciate.
@@simoneobe4284 might be able to put a second object/shader above the surface of the initial voume
Saw your channel in new tubers and thought I'd stop by to see what it's about. Nice work, this is over my head though man haha. keep at it.
Hah, well thanks for checking it out! You started uploading like a month ago right? Some good numbers for one month, keep it up!
actually 28:22 there's no need to multiply Linear01 scene depth by cam's far plane. change the sampling Mode of Scene Depth to Eye will do the same thing
I do love your tutorials but I do have a constructive criticism if you'll indulge me. My only recommendation would be to slow way down during each step so we can see what you're clicking on (for example when making the very first pbr shader), it was extremely hard to see what you clicked without pausing at just the right moment during a few moments in the video. Overall though, I'm extremely grateful for you taking the time to make this and share your knowledge. Thank you, definitely getting another thumbs up!
Cheers dude, I appreciate the feedback. I'll find a good rhythm eventually!
Nice. Combining this with a tutorial on spherical water to see if I can make good water for planets.
If your water is not moving try turning on "Animated materials" in the scene view
This helped a lot. Thanks!
If you are having trouble finding "Animated materials", it's now called "Always Refresh".
great tutorial, learned a lot from you and having self conversations with urself in between the tutorial made my day :) Thanks a lot
You're very welcome! Thanks for the kind words.
i followed one by one but the foam appear to the whole material (plane) instead of surrounding object ( stone )
using uity 2019.1.8
This was happening for me as well because my plane was set to opaque instead of transparent (surface setting in the master node in the shader graph). Might want to check if that is also your problem
Did you ever find a solution to this problem?
@@Miketulli8 same problem. But no use whether I switch to transparent or opaque.
You're incredible dude, keep it up! I managed to adapt this with Gerstner waves to get something even more realistic. Do you have the foam texture though, I can't seem to find any good ones?
I think that foam texture has been lost to the ages, sorry man. It wasn't actually that good though, so don't worry. Just find something messy on google and make it tile.
@@PolyToots I've found some awesome stuff on the Asset Store since, no worries.
Thank! I really like the tutorial, not only because of the water shader, but the way you explain everything you do to create the effect is really cool. One question, Is there a setting to be able to visualize the animation of the shader in real time, when I was working on it I had to play the scene in order to be able to see the effect or select the camera in the Hierarchy panel and see the shader in the Camera Previe. Thanks!!
Yeah there's a little button at the top menu of the "scene" view, it's one of those icons that has a little triangle to indicate more icons of you click on it. One of the options is for animated materials. You must have turned it off at some point because I'm pretty sure it's on by default.
I dont get how yours looks so 3d before any waves, just adding the normals made yours look so good. Even using the same normals mine just looks off when closer to it. How do you setup the normal imag?
Thank you so much for the tutorial. It looks so great with HDRP. For the people who dont have the emission, try adding an emission node in between the clamp and the emission slot of the pbr master. Then set the intensity unit to EV100. An intensity value of 15 worked for me. Also if the water moves with the camera change the first position node (before spliting and combining to RG) from world to absolute world. That should fix it. I also tried to make the waves from this straight line to a more curved line but did't succeeded yet. Does anyone know to do that? I tried messing with the UVs with a rotate and radial shear node but it did't work for me. Maybe someone knows how to do it.
Yeah trying to bend out the noise so they are "curved" instead of straight is going to be tricky. An interesting approach though, stretch them so they're straight, and then try to warp them. You'd probably be better off just starting with the right shape to begin with, instead of trying to fudge a noise node to do it. I think I'll get crackin' on a new water shader soon, this time with proper displacement. Maybe it will help.
Can you show how this would look at 17:47? For some reason when I modify wavetile and wavescale at that point it just doesn't do anything, I think due to the lack of emission when he's testing it.
Hey @Simon +Simon that's fantastic to hear, mine is looking oatmeal-colored for some reason. I'm 6 minutes in and it looks nothing like it does in the tutorial.
Did you come across a similar issue by any chance? :(
@Simon
Sorry, hahaha. Just realised I was being a complete dingus, forgot to "Save Asset" on the shader :grimacing:
Very cool, very informative and easy to understand ) thank you . What you think about book page curl in 3d mesh? How we can do it? Need it for vr quest i am making now at my company. Anyway good luck wait your unity tutorials very often
Thank you for the kind words. Does this page curl need to be based on user input? Like someone dragging their finger/cursor to flip the pages?
@@PolyToots, maybe just pressed button on controller. But I need it to be done not only straith fliping. But with some curve-like style, like in real life) thanks you. Sry for my bad English
I've made a very simple page flip in the past, do you mean something like this: i.imgur.com/icRtKiK.gifv ?
If so, I didn't use unity to make it, just a basic model and rig in 3ds max.
This tutorial is insane bro! nice job!
Great tutorial, just learning Shader Graph and you do a great job of breaking down how/why we're using each piece.
The effect looks fairly similar in my version until I got to the Foam part. Maybe because I'm using LWRP or something but the foam is everywhere in the scene view and then doesn't show up in the game view. Guess I can live without foam for now.
Oh also, it'd be really useful if you sort of panned through the whole Shadergraph at the end so that we can easily check for any mistakes or missed nodes.
I am having the same problem. I get a very strange "halo" effect of whatever is intersecting with my water plane. I took the exact same shader and dropped it into a HDR project and it looks identical to the PolyToots' example.
i.imgur.com/FJnVzrA.png
If you figure it out, let me know!
me too......just break the position pin can fixe that,,, but it doesn't look good in that case
I ran into problems as well here. What worked for me is to set the depth node to Eye space and remove the camera node, then link this to the A slot of the subtract node. Another thing you can do is replace the clamp with the smoothstep node to get a smoother transition (works very well for the object depth) though control is a little more limited from what I'm experiencing
Also: Remember to set the PBR node to transparent, forgot this and nothing seemed to work and caused a major headache hahaha
FOR ANYONE WHO WAS HAVING ISSUES NOT SEEING FOAM. THE ISSUE IS IN YOUR LIGHTING/SCENE RENDERING AND POST PROCESSING SETTINGS. IF YOU LEFT ALL THE SETTINGS AT DEFAULTS IT CAUSES THE FOAM TO NOT BE THERE. if you go into post processing volume settings and disable EXPOSURE then go to your volume settings to your sky settings and also disable EXPOSURE . then go to your directional light settings and change the lux from 100000 to 10, this will fix your issue
On what version of HDRP are you on ?
I tried that and it did not work :(
@@antoinedevldn 6.9
[Shader Graph version 10.3.1 with URP in Unity 2020.2.7f1]
I didn't see foam in my example but it is fixed when I set as foam distance < 1. This one cost me one hour of research but I learnt lots of things.
If you are using previous version of Shader Graph you can also check ZWrite in generated shader code and if it is "Off" then set to "On". (This issue has been fixed in some version of shader graph but don't know which one)
Ah the joys of different unity + shader graph versions. Thanks for the info though Burak, much appreciated.
Awesome tutorial, two things that may help someone else. In URP object in general select the depth texture, without it in play mode the shader doesn't work. And I could find the foam texture that is used in the tutorial.
Man, you saved me a lot of trouble. I wasn't able to make the foam work without this. Thank you very much!
Thank you very much!
Awesome tutorial, well explained and all. Now my procedural land generator can gerenerate beautiful water too :)
Such a great, in-depth(pun intended) tutorial. Thank you. Keep up the good work m8.
Also. I like how you assume that your audience has watched previous tutorials. That makes it more rich.
Cheers man, always nice to read nice comments!
Would this work with rigidbodies? I notice the wave is moving, but not the object. I am looking to create a water system for a game but I have never done water before. I was thinking of using this as a base inspiration to show me how it could be done. But before I go through the whole thing, I'd like to know.
This works in Unity 2020.3.32 where PBR is deprecated. Works with URP not try with other pipeline yet
This is wild bro thank you.
Great tutorial! One problem i ran into is that the foam doesn't seem to work on an object with one of my own pbr shaders. Any idea what i'm missing? EDIT: It doesn't work on objects with textures set to transparent apparently, leaving it here in case someone else has the same issue.
i have the same issue
I'm still watching. I am at 10:13. The offset is basicly an add operation on the UVs
Scene depth is 0 to 1 depending on the depth. If you multiply that with the camera far plane you get the distance from camera to the point in the scene. Shadow calculations in the 90s leveraged that alot.
Now you take the screen position raw to get the distance camera to your other object, because your water is "transparent". It will be ignored here. You move the distance nearer to the camera with a subtract. That is equivalent in moving all objects nearer to the camera in regards of depth.
Now you subtract water distance with the none transparent moved distance. Everytime this is minus you have objects out of the water but closer to camera caused you moved them. One minus does the trick here and clamp fixes values below 0. That is how the projection works IMHO
Solid comment! Thank you so much.
@@PolyToots Another tip of mine: look at ruclips.net/video/jBmBb-je4Lg/видео.html he solves it differently. Sorry if you don't want me to link other channels (this is not my channel). Tell me will remove the comment.
Yeah I think I've seen this before, I'll have to have another look. No worries about linking other channels, we're all here for knowledge, doesn't matter where it comes from.
14:39 I think you could also use a one minus node and take the first timer as it's input. It's less clutter than another timer.
If I may ask, where did you get your ocean normal map? I tried to use the one from the tutorial with Amplify Shader, but maybe I converted it in Unity wrong or something? No matter what I do I cannot get my water to look like yours, or be as shiny/detailed. At first it looked extremely flat, I messed with settings to get it okay, but other normal maps worked better. It still looks nowhere near as good as yours though, is there any trick to importing a normal map for this?
I've had that greyscale map for so long that I can't remember if it was one I made or just grabbed from google. But, to hopefully fix your issues, here's my conversion settings:
Bumpiness: 0.1
Filtering: Smooth
Then on the shader/material itself, I bring the normal map strength down to about 0.25. Oh, and my smoothness value is about 0.8. you'll definitely need smoothness otherwise the normal map will look flat.
@@PolyToots Hey, kind of late to the game, but I've followed these steps and I seem to be getting this strange streaky mapping effect, almost as if the map's only being repeated on one axis and stretch all along the other, I've taken a screenshot of what im talking about here: pasteboard.co/Iwo1JaA.png
If anyone has any suggestions they would be an absolute life-saver!
Always better to be safe than sorry and order your coefficients correctly when doing multiplication, right? I thought I was bad at math but holy hell I'm honestly impressed how much is possible nowadays with absolutely zero understanding of basic grade school math principles. That statement blew my mind.
I don't know what statement you're referring to, but in the future if you've got a point to make it wouldn't kill you to be nice out about it. Maybe you see something wrong in peoples videos and can help?. Because you're right, I am not good at math, never was, and I am amazed at the things I can do when I keep trying, it makes me happy. Don't try to take that away from people.
"That statement" bro what statement it's a 40 minute long video haha
Hey! Any chance you could make a low poly style water shader?
Great tutorial!! would love to know how I can get this to work with LWRP! have you found out why it doesn't? thanks!
It's something to do with the way Unity orders the depth and vertex offsets, sorry man!
Hey, I love you tutorial's
Been experimenting with this... Why not in the last step take a Scene Color node rather than a Color node? You can even distort the UVs on that, if you want. If you then modulate the amount of distortion with your screen depth construct, you can make relatively convincing light scatter...
I don't think that node existed back when I did the video. (May 2019). I remember something about grabpasses being totally bonkered at the time.
Thank you so much. Amazing tutorial with perfect explanation on how everything works/
SOLVED - Guys I am also faced with a foam problem with both 2019.4 and 2020.1 versions. I have tried all possible solutions mentioned in other comments bu couldn't make it happen. Then I changed the max values of 'Clamp' which connects to the emission, so foams are appeared.
Just set max values to 100 (x, y, z).
Any thoughts on why it is that @ 17:49, when you adjust the wave scale, it changes but when I do it nothing happens? I tried adjusting the Vector 2 values, as well as the wave tile value, just in case my water tiles were way different that yours but I'm still coming up short. imgur.com/a/mgYCvMs (Unity 2019.1.14f1)
I am also having the exact same issue with HDRP, did you ever figure out how to resolve this?
Hello. Do you know if this would work in VR with single pass instanced? A download link would be nice as well :)
Do you have a picture of your node graph?
Hellow, PolyToots!
Greate lessons!
Can you help with one problem?
When i try to apply your shader to sphere - seams appear. I think this is because you are using the World coordinates. Is it posible to fix it? I want to create a ball of water)
Thanks.
You could try just using a regular UV node, though I think the default unity sphere will still have a seam. Another option is to use triplanar node instead.
@@PolyToots Thanks!! UV node helped)
Idk why, but I am using unity 2019.3 with HDRP and the foam doesn’t work for me even when I set the water to static or not, and I tried both pbr and lit shaders but nothing. It just doesn’t show up
same problem
you're probably using realtime lighting
RoboticGaming101 yea I am using real-time lighting for my game
@@rambii. thats why. but just use an add node to add the albedo with the foam and put it in the albedo and not emission.
RoboticGaming101 that’s what I did instead. Something I somehow figured out on my own while trying different ways of getting foam for work
Hey man, I was wondering if there is a fix for the material looking really bad when viewed from directly above. Is this because it is just a normal map and not an actual mesh, or did I do something else wrong?
Amazing tutorial! Thank you for sharing it.
Really love the tutorial so far. 14:53 in the video and will finish rest tomorrow. Understanding everything. I found using Sub Graphs makes everything cleaner and easier to read. I have one for the color and one for the normal tiling logic. If Its possible where can I find the Normal Map your using. The one I'm using is not so good. Smoothness looks really weird. I'm using Universal Render Pipeline(Formerly LightWeight) in the current 2019.3 Beta
Ah I really need to update the description of this! Sure, the normal map I use is this greyscale image (you'll need to convert it to a normal map in unity inspector) www.dropbox.com/s/hb5ror23d0hphef/WaterBump.jpg?dl=0 I use the "smooth" option and use a low value for strength.
Will this method work in HDRP ?
Hey! Sorry for my English!
Is it okay if my plane is pink from the beginning ? I follow everything like on the video but can not understand why my material does not change a color :(
Should i continue and it will change later?
Sorry for my question if it too simple ... im beginner of Unity :D
Hello, no that's probably not good at all! Pink usually means a missing reference, in this case I would assume that what you're missing is probably the correct rendering pipeline.
This is a bit complicated nowadays, especially for beginners. But basically you need to decide between "HDRP" or "URP" rendering pipeline, and then you would install ShaderGraph from the "Package Manager" (though it usually comes installed by default now)
Great tutorials video!
But can you help me with one thing, please?
I'm just a beginner so please don't mind me with little problems. So when I right-clicked to the PBR Graph, clicked create, then added material. Why did my material turn into pink??
I searched up and look at every video, but it didn't quite help me.
So if you know please help me.
By the way, the rest of your video is great... I LIKE IT.
Yeah so you'll need to install a render pipeline too, as at the moment shader graph is not compatible with default unity rendering. There should be loads of tutorials about how to do this though, maybe try searching for something like: "unity how to install render pipeline" or "installing LWRP or HDRP"
Thanks for the tutorial.. the scene depth is driving me nuts in lwrp though..
Audio?. Knowledgeable?. Yes, I am. I'd suggest a Blue microphone or simple usb equivalent. Make it easy on yourself..
Or you could get a little behringer usb 2 channel input box with phantom power and preamp for about 20-30 bucks U.S.
Then, you can use a phantom powered condenser mic of your choice and you'd have a preamp to boost your signal..
ART makes an affordable preamp / limiter that sounds pretty good if you really need the extra overhead for recording anything more dynamic than video narration.
Get a unidirectional mic. Think about the angle of reflections.
Don't back yourself into a corner or against a wall when recording. If you do, pad the wall behind you..
Thanks again. This shader looks really good in my scene. :)
Cheers man, some good information for me to digest there.
Thank you for the tutorial. Just have to wait for them to fix the bug for URP so that the foam texture applies to the foam regions. Right now it's just solid white. I tried the methods in the forum link posted but no luck :/
so it is a bug? I thought I've done it wrong so I check the shader many times.
Hi! i have the same problem. Have you fix this one?
Hello!
Is there a way to draw foam on the sides of the object? cos no foam is drawn because the shader does not detect an object close to the surface. Thank u!
The issue with using the Scene depth for the foam mask is that if you place a cube in the water and you look from above, you will se no foam (to see this, place a cylinder, cube or capsule at 0,0,0, not rotated. Place the camera just above looking down). I hope unity will give us distance fields so that we can get a better solution.
How the hell are you cloning the planes and having them snap on borders? I've been googling for 30 minutes and haven't found anything that works like what you've shown.
Sorry! I know how that feels too, I'm thinking I should get one of those hotkey-visualiser thingies. Anyway, the trick here is not that it's necessarily snapping to the bounds, It's just that I'm moving it by holding down the left "Ctrl" button, which moves objects by increments of 0.25. Oh, and duplicating with Ctrl + D if you didn't know that yet.
Sometimes this doesn't always work though, original starting transforms and of course an objects scale will effect the result. Default planes just happen to be 10 units big, so it's a nice easy number to reach. If you want to snap objects together that are not following any sort of logical grid, you can hold the "V" key down with an object selected, the cursor will change slightly, and you can grab a vertex point from the mesh, and move the entire mesh to another objects vertex point.
Thank you. Would this be expensive on a mobile device?
I would say so yeah, you'd probably want to drop the depth completely for mobile. But, no harm in trying right?
Excellent Tutorial! Bravo !
Awesome tutorial! Thanks
I used some features from this tutorial and added them to another shader graph and it's working beautifully in HDRP. Only problem is that there is a lot of banding due to the noise and fresnel for the vertex displacement for the waves. How can I avoid the red color bands in the water?
Excellent work!
Hey! Thanks for that tutroial. I have just one question: In the Scene View it looks great(just the bug of the foam) but when I am going in the Game Scene it will turn pink. Do you know why?
That's pretty weird, is it just pink in the game view even if you're not in play mode?
hi. I followed your video. But, Why my example is not showing foam.
Where did you get the 2D texture? You never even dragged it into yours node.
Hi, what time in the video are you referring to?
@@PolyToots
There is no time that you reveal where you got the texture. Around 3:50 is where you reveal you have a texture.
I see no texture at 3:50, just nodes. The only time I put a texture in is between 6:20 and 6:25 (it is extremely fast to be fair). Are you talking about the texture property in shader graph? At the time you mention, I put down a Sample Texture 2D node, this is recorded and I can see it in the video, and then at about 4:01 I create a Texture2D property, which I rename to "Normals", and then drag it into the view and hook it up, again this is all recorded and I can see that it's happening.
@@PolyToots
That did not answer my original question. But I found another tutorial that did.
Because I still have no idea what your original question was, the only dragging of anything related to a 2D texture I did was at about 4:01 where I dragged the empty property from the blackboard, and hooked it into the Sample Texture 2D. I'm not trying to have a go here, I genuinely want to understand you because if there's a problem then I can avoid in the future but If I didn't do something you think I did and that is what confused you, then there's not much I can do about that, since I did not do it. Still though, best of luck with your shader journeys.
Not sure if someone asked before but, how would you use for example a displacement map for the vertex displacement instead of the simple noise you´re using? Because even importing a higher density plane the simple noise just doesn´t give me the effect I´m looking for
You can use whatever you want in place of the noise, that only dictates how the water moves, so if you plug something completely different in its place, you'll get a different result. I'm assuming what you want is maybe more along the lines of a "Gerstner" wave, so have a look for that. One commentor on this video: ruclips.net/video/DtycHSpDhXY/видео.html (check the pinned comment) has supplied his own version of these waves with shader graph.
Masterpiece
Great tutorial
This video is perfect to me to work on my small project. I have a quick question about it. How do you make the water transparent? After I made it as a transparent, and whenever I moved my camera angle, it was disappeared :(
Hi, that sounds pretty strange. Are you using a value between 0 and 1 for your transparency, or anything else?
What should I do if my water doesn't look like yours at all? I have a very strange one. Perhaps this is due to a different version of Unity where the Shader Graph was changed. My water is not properly reflected and seems to mix. If possible, could you update your tutorial to the latest version of Unity and Shader Graph?
Superb, thank you so much.
For those wondering why the emmision doesn't work on HDRP:
Set the water to static
Audrey B May I ask where is the option to set it to static?
@@rambii. there's a tickbox in the top right of the inspector
@@hhhhhhhhhhhh7165 That didnt fix it for me
@@4ghzgaming664 You can try adding an emission node before connecting the clamp to the emission slot of the master node. Then try out the values for the intensity with the intensity unit set to EV100. 15 worked good for me.
@@Simon19903 It didn´t worked for me, do you have any advice ? :D
I love the Hybrid branded audio Interfaces they really cancel out noise and look pretty cool lol I also recommend using some kinda of sound absorbers to eliminate the roomy sound
Cheers Nala (again), I will look into Hybrid for sure. Sound absorbers might not be feasible in my flat, but I'll see what's available and keep it in mind for the future. Thanks again!
If you're facing an issue where the foam covers the entire surface of the water try setting the surface type to transparent in the graph settings, that's what worked for me
Oh mate, many thanks, worked for me!!!
Thanks so much!
Can this be used for underwater wave effects for VR?
Because of a missing PBR Shader in this version I'm using the [HDRP -> Lit Shader Graph] insteed.
The part with the waves seems not to work with HDRP in Unity 2020.2.
Tried it also with the recommendation of [Simple Noise][Out] -> [Emission Node][Color] and Emission of the Main [Fragment][Emission]. Changed also the Intensity Unit to EV100, played with Intensity and Exposure Weight values. Nothing helped me..
Hi, I'm having a little trouble with the normal map, It seems a little bit "Flat" compared to what is shown in the video, is there something that I could be doing wrong?
Go into the Texture folder in Assets where you placed the downloaded Normal image. Select it. Change the Texture type to Normal Map : Shape 2d and Check Create from Greyscale.
I am unable to find the foam texture... could you supply a link to it? Thanks!
I think it was this one: imgur.com/MSfgtyg but honestly it's pretty terrible.
@@PolyToots Thanks!
About the only way to perform UV offset, why don't just just add a vector2 to your actual world UV (using time * vector2)? I always used a add and multiply on ASE to perform tiling and offset, and I'm pretty sure the Tiling and Offset nodes are doing that behind.
Cheers, I'll give it a whirl.
PolyToots, amazing tutorial, it helped me a lot!
But I'm running into an issue: I apply this shader to my plane, then duplicate this plane to create my ocean. In the editor, it is fine but once exported in-game, the ocean is misplaced (way too higher on the Y axis than in the editor), also the planes are culled too soon, they disapear while mid screen. If I apply a basic material to the planes, it doesn't happen any more. Any idea on what is going on?
That sounds pretty weird. What unity and shadergraph versions are you running? I've had people report depth issues on LWRP, but nothing like what you're describing unfortunately.
@@PolyToots I'm on Unity 2018.3.12f1, as for Shadergraph I can't tell, but that's the vanilla version. I'm also using HDRP.
Here is a link to an .unitypackage file with my shader and the plane I'm using to make the ocean: mega.nz/#!dvxHRAYY!U1tHY6HQFnwVPid5KzjE5gG3qZMQczKVmZv5QkDm7VA
I have a question about the world coordinate tiling method. Is there any way to make that work in three dimensions? Seems whatever I try, I can only get it to work in a single plane per shader, can't even tilt it... I feel like I need to do some math using the normals to determine what plain I am in, but...
What you're looking for is a "triplanar" shader. I have a tutorial for it with shader graph, but I think both shader graph and amplify have a triplanar node. The downside of using a node is you can only hook in one texture (I believe). The tutorial on my channel shows how to make your own, that way you can hook up to 3 textures in. Like if you wanted grass to always be on top for example.
@@PolyToots Thanks. I will look into that soon.
@@PolyToots I looked into triplanars, and they are indeed incredibly useful to map all of world space onto UVs. Sure beats doing the math by hand with the normal vector etc...
I found I can even do a directional mapping this way, which has really allowed me to give this effect some serious depth while still flowing down a slope.
Thank you but i have 1 proplem 30:21 this not working foam fot working i cant see foam
I had a similar problem, my fix was convoluted though. I set the lighting under project settings to Linear and it suddenly worked. However, I lost the lovely sparkle that the water had. I'd love to get that back if anyone has any ideas.
Has anyone found the fix? I too have followed everything verbatim up until the foam and I can't seem to see the foam emission at all regardless of toggling a bunch of different values at this point. I tried setting my objects to static to see if that would make any difference. I'll try the linear lighting route and see if I can find a fix by experimenting with those options. I'm using version 2019.2.5f1 with HDRP. Not sure if that makes a difference.
Thanks a lot for posting this tutorial! One issue I've come across is in HDRP, using the TAA (anti-aliasing) in the Camera settings creates a ghostly effect whenever another object moves in front of the water (such as a character). If anybody finds a solution to this, would be highly appreciated!
My PBR master has Vertex Position, Vertex Normal and Vertex Tangent. If I plug the Vector3 from the wave strength into Vertex Position... it just kind of makes the whole plane move up and down with only minimal "waves" - hardly look like waves at all. Its not to do with wave strength - I increased that and still hardly any definition between waves.
Tried on URP 2019.3 and everything except the foam works fine and awesome.
PS: I have already tried everything that any of the comment states so if anyone knows how the foam thing can be solved in URP then please let me know, much-needed help.
Awesome tutorial by the way.
the foam is like above the surface and not around the object, anything?
Thanks for the tutorial, however I followed it almost perfectly and still have a issue, seems the water is moving with the camera, it's making me motion sick lol, Any tips? ty.
You're not the first to have this issue, but I checked recently on mine and all was well. I would pay special attention to everything going into your emission slot, things like the Camera node using the Far Plane, and Scene Depth being set to Raw, and of course make sure the connections themselves make sense and you're not hooking things into the wrong multiply's or anything.
@PolyToots I honestly checked over and over again and everything is exactly as it should be not sure what I'm doing wrong. I even went that extra mile to keep the whole thing looking like whats on your screen.
@@PrincessSleepyTV I had this problem too. You can try changing the first position node(before the split and combine to RG) from world to absolute world. This worked for me😊
Fog of War shader / renderer with the ability to have arbitrary number of arbitrary-sized (view radius) view points (tower/unit/etc positions)?
Sounds codey to be honest, but I'll keep it in mind!
@@PolyToots Maybe a stencil cutout with gradient masks? Hmmm, not sure. I did a single object cutout recently, but I doubt it would be performant considering "arbitrary"
Beautiful
At first thank you very much for the awesome tutorial, and second could you share with us the normal map you used for the ocean water please. will be grateful.
Sure thing, it's a grey scale map so you'll need to convert it to a normal map in unity. Make sure the settings are not too strong when you do it: imgur.com/4bgAedW
LOVE UNITYYYYYYYYYYYYYYYY!!!!!!!!!!!!
Is there a way to have objects reflect in the water?
I mostly do all reflections these days either with reflection probes (which I believe are supported by default) or a screen based post processing effect. So on the shader side there's not much I do with reflections, unless it's like old-school forced cube mapping onto the material itself.
Great tutorial. Having an issue with only seeing one layer of the water moving. It's not showing transparency. Any help with that?
Hey Jeffrey, so you can see both layers, but only one moves, or you can only see one?
@@PolyToots Only see one
@@jeffreyhawkins8714 Could you share your shader so I can take a peek?
What are the settings on your normal map?