After coming back to this tutorial and seeing people's questions/issues, here's a couple of tweaks you can make to fix bugs or just change how the shader appears: Sometimes you'll see a strange white outline around objects standing in front of the water. In the video, at roughly the 4:40 mark, instead of hooking up the Step node into the brand new Lerp node, we'll add a Comparison node after it, with the Scene Depth node in eye-space in the A field, the raw Screen Position node's alpha component from the Split node in the B field, and the mode set to Greater. Plug its output into a new Branch node's Predicate field, pass the Step node output to the True field, and set the False value to 1. Pass the Branch output into the new Lerp node instead, and it should fix the issue! The stylised hard-white intersection might not be what people want - if you want the intersection to have a smooth alpha falloff, just bypass the Step node and directly use the Saturate node output. You'll get a nice gradient of white dipping into the water.
It's gonna be a long time before I can handle stuff as advanced as this, but when I can, I'm definitely coming back to this video. Thanks for making it.
@@danielilett Shaders are going to be a long way off - I've only done rudimentary projects in Unity. I hope to go into Game Design eventually, and I feel like I need some kind of technical skill to be able to model in blender and make some stuff in Unity.
@@WasatchWind mostly its just grinding out the practice until you get the hang of it. I have taught myself everything and i do not consider myself technical at ALL. :D
for people having trouble with intersection foams (depth testing), in MainCamera -> Rendering: set Depth Texture to On. Weirdly, changing the anti-aliasing parameter in from FXAA to SMAA also worked (probably SMAA enables depth texture).
If anyone having trouble with waves, try changing multiply node that connects to vector3's Y value to Z value. I imported a model from Blender and Blender uses Z axis as Up while Unity uses Y axis. I also had to lower the Choppiness value. It was a great tutorial though, thanks!
Good to know! I used Unity's primitive shapes and didn't really think about importing models, so that makes a lot of sense. Choppiness is gonna depend on your personal preference and the mesh you chose. Glad you liked the tutorial :)
[1:56] Section "Flow Map" How did you put this section called "Flow Map"? I'm a novice and I don't know how to create it and I find it very useful to order the nodes.
If you're making an isometric game and you're having issues with the shader rendering on top of other things try putting the blending mode to "additive" in the Graph Inspector. You can also try enabling "Allow Material Override" but this created weird artifacts for me.
Wondering if anyone else has this issue. So the foam intersection appears in my scene editor but as soon as I enter the game window or press play, no white foam intersects at all. Anyone else?
Long shot here, but how would I go about tiling the voronoi texture when I apply it to the material? For example I am using a plane that is 100x100 units, so the texture looks MASSIVE and doesnt fit, but tiling it would solve my issue, do you know how i could possibly solve this?
Is anyone able to get this working in v2022.3.34f1? My is broken, even when dragging and dropping from the github example. No errors or warning given in the console.
For anyone struggling to get the intersection foam working (especially in newer versions of Unity, I'm on 2022.3.14), the problem might be that unlit shader's graph settings seem to default to different values/perhaps Daniel changed them somewhere and missed it - but the thing breaking it for me was not having the Surface Type set to Transparent and also Alpha Clipping and Cast Shadows were disabled by default - might've just been me being dumb but might save someone else some time!
This shader is great! Only thing I couldn't get working was the foam on the edge of meshes in the water. I'm not 100% sure why it didn't work, but the shader still works nice!
Having a small problem when my character is in view with water there is white outline drawn around my character.how can I solve this ? Please and thank you.
That issue is to do with the way the shader draws intersection foam around objects submerged in water - there's a bug I couldn't quite fix where it affects objects in front of the water, too. To fix it, you can do these steps: In the video, at roughly the 4:40 mark, instead of hooking up the Step node into the brand new Lerp node, we'll add a Comparison node after it, with the Scene Depth node in eye-space in the A field, the raw Screen Position node's alpha component from the Split node in the B field, and the mode set to Greater. Plug its output into a new Branch node's Predicate field, pass the Step node output to the True field, and set the False value to 1. Pass the Branch output into the new Lerp node instead, and it should fix the issue! Hope that helps. For funsies, after a bit more tinkering, the stylised hard-white intersection might not be what people want - if you want the intersection to have a smooth alpha falloff, just bypass the Step node and directly use the Saturate node output. You'll get a nice gradient of white dipping into the water.
@Daniel Ilett Inside the water depth color, I should be able to ignore drawing the foam around things that are higher than the water line.. But I'm not sure how I'd do this, any tips?
The problem I am having is the Step node is causing the center of the plane to become white, rather than the edges of the plane. However, on the very edges of the plane I can see the various blue colors moving around. I have enabled Depth / Opaque Textures in my URP Asset, and I have tried the steps within Daniel's pinned comment (which gives me the right texture, but then it is blotchy with a ton of white spots). I'm not sure what I'm missing.
Great tutorial! I can't get the waves to form like yours does. Is that due to not tiling the plane? I tried scaling it up but still no waves. I've triple checked the wave section of the shader graph but it's the exact same.
Hey, fantastic tutorial and really good looking stuff! I've just finished my own version with a texture I made myself and it all looks beautiful but I can't get the intersection to work correctly at all. I've set everything up exactly as is shown, and made the adjustments in your pinned comment as well. I don't expect you to be able to diagnose my issue, so instead I'll ask: Does this solution still WORK in Unity 2022, and I have implemented it incorrectly, or is this simply no longer working?
Hi! Sorry about my terrible english😅 You really helped me by this amazing tutorial, but I have a little problem. I was following your tutorial at my private project, and then I duplicate the work to another project. but when i apply the duplicated meterial to the new plane, the foam doesnt shows. there was no problem in the previous one. the project settings, shader node, and the texture are completely same. i have no idea about this so i want to ask you about it. what do you think?
am glad i found this channel, i do my shader with Amplify but the Technics should be the same. Edit: mind sharing a link on how you created your tilable voronoi texture ?
I really hate to disappoint, but I made it manually! I placed a bunch of lines on a texture in a vaguely "voronoi-like" style and made sure they lined up when they scroll off the edge of the texture.
Which Unity version and render pipeline are you using? There's a couple potential reasons for this error. I made this in URP and it sounds like you might be importing it into HDRP? In that case, I'm not sure what the fix is (since I rarely use HDRP), but you will probably be able to solve the problem either by manually adding a new master node and reconnecting the wires to the new one (make sure you right-click the new master node and set it as the active one). Or, you're potentially using URP on a new Unity version. I made this video using 2019.3, and Shader Graph changed a bit since then - since 2020.1, Shader Graph uses a single Master Stack instead of different Master Nodes. Potentially there's been an issue importing the shader into a new version, although it's *supposed* to automatically update it. In that case, try deleting the master node and connecting its inputs to the corresponding master stack pins instead. If there is no master stack, then maybe try creating a fresh graph and copying the nodes/properties over - might be a bit tedious but that should hopefully fix it. If you're using Unity 2019.3 and URP then I have no clue what the problem is, and Unity is being weird.
Have bit of an odd error. When I either try to recreate the shader or import it, I find that it just shows as a flat grey color in game view. It appears correctly in editor. Upon a closer look, it appears that the entire shader is showing nothing but the light foam color across the entire material. I am wondering what might be causing this. I don't believe it is the shader at the moment, but maybe something else since the effect shows correctly everywhere but game view.
Someone had a similar issue the other day that was solved after they realised that they hadn't set the material to Transparent, but the fact it works in the Editor for you suggests that you've probably already done that. The only other thing I can think of is that the Scene View camera uses different near/far clip settings than your in-game camera likely does, and that could be interfering with the foam calculations somehow. I'm assuming it looks incorrect if you build the game too?
As far as I'm aware, there's no magic way to directly convert Unity shader graphs into Unreal materials. However, the Unreal material editor is fairly similar to Unity's shader graph editor, so it'll have similar nodes to work with. It's been a while since I touched Unreal, but I'd wager it wouldn't take a million years to do the conversion by hand (although you might face difficulty when you get to the part about using eye depth to calculate intersection foam, Unreal probably has a different system for this). As a side note, I'd love to put out tutorials for other engines in the future, although that will take A LONG time.
@@danielilett Thanks for the succinct answer, I wish it wasn't kind of over my head still, but that is a failing on my part to understand, such is the life of a game dev.
I've toyed around with a couple of designs already and when I think up something more exciting, I go back and update all of them. For now I think they're fine but inevitably I'll change my mind and update them sometime in the future! But might be helpful to know, what parts of them feel bland in particular to you?
After coming back to this tutorial and seeing people's questions/issues, here's a couple of tweaks you can make to fix bugs or just change how the shader appears:
Sometimes you'll see a strange white outline around objects standing in front of the water. In the video, at roughly the 4:40 mark, instead of hooking up the Step node into the brand new Lerp node, we'll add a Comparison node after it, with the Scene Depth node in eye-space in the A field, the raw Screen Position node's alpha component from the Split node in the B field, and the mode set to Greater. Plug its output into a new Branch node's Predicate field, pass the Step node output to the True field, and set the False value to 1. Pass the Branch output into the new Lerp node instead, and it should fix the issue!
The stylised hard-white intersection might not be what people want - if you want the intersection to have a smooth alpha falloff, just bypass the Step node and directly use the Saturate node output. You'll get a nice gradient of white dipping into the water.
this explanation is kinda confusing, is this updated in your github repository?
I have got it to work. Check the shader lab for my post on the solution.
Here's a screenshot of these instructions to help anyone that might need it. Works as intended for me :D ty ty
imgur.com/a/Un3fR04
@@veniaminvigovsky I have this issue too. If anyone figures out a way to solve this, I would be interested for sure.
@@_stephenhubbard Thanks a lot
It's gonna be a long time before I can handle stuff as advanced as this, but when I can, I'm definitely coming back to this video. Thanks for making it.
You're welcome, good luck with your shader journey! Hope to see you back here soon.
@@danielilett Shaders are going to be a long way off - I've only done rudimentary projects in Unity. I hope to go into Game Design eventually, and I feel like I need some kind of technical skill to be able to model in blender and make some stuff in Unity.
@@WasatchWind mostly its just grinding out the practice until you get the hang of it. I have taught myself everything and i do not consider myself technical at ALL. :D
for people having trouble with intersection foams (depth testing), in MainCamera -> Rendering: set Depth Texture to On. Weirdly, changing the anti-aliasing parameter in from FXAA to SMAA also worked (probably SMAA enables depth texture).
You have no idea how long I've been looking for EXACTLY this. Thank you!
im not gonna ask if you came from dani because you know it
Your pace is a bit too fast, but this is an amazing tutorial. Simple and straightforward.
I know this is late but I recommend playing this video in 0.75x if the video is too fast
If anyone having trouble with waves, try changing multiply node that connects to vector3's Y value to Z value. I imported a model from Blender and Blender uses Z axis as Up while Unity uses Y axis. I also had to lower the Choppiness value. It was a great tutorial though, thanks!
Good to know! I used Unity's primitive shapes and didn't really think about importing models, so that makes a lot of sense. Choppiness is gonna depend on your personal preference and the mesh you chose. Glad you liked the tutorial :)
[1:56] Section "Flow Map"
How did you put this section called "Flow Map"?
I'm a novice and I don't know how to create it and I find it very useful to order the nodes.
If you're making an isometric game and you're having issues with the shader rendering on top of other things try putting the blending mode to "additive" in the Graph Inspector. You can also try enabling "Allow Material Override" but this created weird artifacts for me.
Here before the flood of new subscribers coming from Dani's new video
I have no idea what the hell just happened here, but it looks great.
Wondering if anyone else has this issue. So the foam intersection appears in my scene editor but as soon as I enter the game window or press play, no white foam intersects at all. Anyone else?
This is a great tutorial, if a bit fast!
Keep it up! :)
That looks fantastic
Wow. Great work!
Great video! I’ve been thinking about how to achieve this for a while!
Long shot here, but how would I go about tiling the voronoi texture when I apply it to the material? For example I am using a plane that is 100x100 units, so the texture looks MASSIVE and doesnt fit, but tiling it would solve my issue, do you know how i could possibly solve this?
have you figured this out?
How could i work this around with tiles so i can shape a plane however I want without stretching the shapes?
Is anyone able to get this working in v2022.3.34f1? My is broken, even when dragging and dropping from the github example. No errors or warning given in the console.
For anyone struggling to get the intersection foam working (especially in newer versions of Unity, I'm on 2022.3.14), the problem might be that unlit shader's graph settings seem to default to different values/perhaps Daniel changed them somewhere and missed it - but the thing breaking it for me was not having the Surface Type set to Transparent and also Alpha Clipping and Cast Shadows were disabled by default - might've just been me being dumb but might save someone else some time!
Do you know by any chance what is the solution for Unity 6? I cant seem to find the proper shader unlit graph .....
at certain angles/positions material is not visible? anyone know why that might be happening?
i want the water to conform to a simple cylinder, if someone sees this and can help that would be cool
This shader is great! Only thing I couldn't get working was the foam on the edge of meshes in the water. I'm not 100% sure why it didn't work, but the shader still works nice!
Having a small problem when my character is in view with water there is white outline drawn around my character.how can I solve this ? Please and thank you.
That issue is to do with the way the shader draws intersection foam around objects submerged in water - there's a bug I couldn't quite fix where it affects objects in front of the water, too. To fix it, you can do these steps:
In the video, at roughly the 4:40 mark, instead of hooking up the Step node into the brand new Lerp node, we'll add a Comparison node after it, with the Scene Depth node in eye-space in the A field, the raw Screen Position node's alpha component from the Split node in the B field, and the mode set to Greater. Plug its output into a new Branch node's Predicate field, pass the Step node output to the True field, and set the False value to 1. Pass the Branch output into the new Lerp node instead, and it should fix the issue! Hope that helps.
For funsies, after a bit more tinkering, the stylised hard-white intersection might not be what people want - if you want the intersection to have a smooth alpha falloff, just bypass the Step node and directly use the Saturate node output. You'll get a nice gradient of white dipping into the water.
I love this guy.
Great pacing! Great Tutorial
@Daniel Ilett Inside the water depth color, I should be able to ignore drawing the foam around things that are higher than the water line.. But I'm not sure how I'd do this, any tips?
The problem I am having is the Step node is causing the center of the plane to become white, rather than the edges of the plane. However, on the very edges of the plane I can see the various blue colors moving around. I have enabled Depth / Opaque Textures in my URP Asset, and I have tried the steps within Daniel's pinned comment (which gives me the right texture, but then it is blotchy with a ton of white spots). I'm not sure what I'm missing.
Are you able to link me to a screenshot of what your water looks like? Might help me figure out what's wrong a bit easier!
@@danielilett I'll get those sent over on your Discord later tonight. Thanks!
Thank you for the tutorial.
Came from dani hope you get a lot of subs
Awesome Video!
Im in your server! Im alex aka 0160
Great tutorial! I can't get the waves to form like yours does. Is that due to not tiling the plane? I tried scaling it up but still no waves. I've triple checked the wave section of the shader graph but it's the exact same.
Ugh! It was because I didn't have the choppiness setting at the right level. For future reference 0.33 is a good value.
Has anyone been able to create create the texture he made but using nodes? Like start with voronoi and change it so it comes out somewhat clean?
Hello does this respond to fog
Hey, fantastic tutorial and really good looking stuff!
I've just finished my own version with a texture I made myself and it all looks beautiful but I can't get the intersection to work correctly at all.
I've set everything up exactly as is shown, and made the adjustments in your pinned comment as well.
I don't expect you to be able to diagnose my issue, so instead I'll ask: Does this solution still WORK in Unity 2022, and I have implemented it incorrectly, or is this simply no longer working?
Hello, did you manage to solve the issue or find any workaround?
Hi! Sorry about my terrible english😅 You really helped me by this amazing tutorial, but I have a little problem. I was following your tutorial at my private project, and then I duplicate the work to another project. but when i apply the duplicated meterial to the new plane, the foam doesnt shows. there was no problem in the previous one. the project settings, shader node, and the texture are completely same. i have no idea about this so i want to ask you about it. what do you think?
the intersection is not working, anyone has the same issue?
am glad i found this channel, i do my shader with Amplify but the Technics should be the same.
Edit:
mind sharing a link on how you created your tilable voronoi texture ?
I really hate to disappoint, but I made it manually! I placed a bunch of lines on a texture in a vaguely "voronoi-like" style and made sure they lined up when they scroll off the edge of the texture.
@@danielilett haha no worries, Blender should be able to do it though
i have a litte pop up saying that "the current render pipeline is not compatible with this master node" how do i fix that?
Which Unity version and render pipeline are you using? There's a couple potential reasons for this error.
I made this in URP and it sounds like you might be importing it into HDRP? In that case, I'm not sure what the fix is (since I rarely use HDRP), but you will probably be able to solve the problem either by manually adding a new master node and reconnecting the wires to the new one (make sure you right-click the new master node and set it as the active one).
Or, you're potentially using URP on a new Unity version. I made this video using 2019.3, and Shader Graph changed a bit since then - since 2020.1, Shader Graph uses a single Master Stack instead of different Master Nodes. Potentially there's been an issue importing the shader into a new version, although it's *supposed* to automatically update it. In that case, try deleting the master node and connecting its inputs to the corresponding master stack pins instead. If there is no master stack, then maybe try creating a fresh graph and copying the nodes/properties over - might be a bit tedious but that should hopefully fix it.
If you're using Unity 2019.3 and URP then I have no clue what the problem is, and Unity is being weird.
@@danielilett thank you so much, I'm using unity 2020.1 so this was very helpful!
Have bit of an odd error. When I either try to recreate the shader or import it, I find that it just shows as a flat grey color in game view. It appears correctly in editor. Upon a closer look, it appears that the entire shader is showing nothing but the light foam color across the entire material. I am wondering what might be causing this. I don't believe it is the shader at the moment, but maybe something else since the effect shows correctly everywhere but game view.
Someone had a similar issue the other day that was solved after they realised that they hadn't set the material to Transparent, but the fact it works in the Editor for you suggests that you've probably already done that. The only other thing I can think of is that the Scene View camera uses different near/far clip settings than your in-game camera likely does, and that could be interfering with the foam calculations somehow. I'm assuming it looks incorrect if you build the game too?
it doesn't tile?
For some reason, on the scene it looks good! but in the game mode it looks just white after adding the scene depth part :c
oh nevermind, my renderasset was not well configured lol
The eternal struggle when dealing with render pipelines! I trip up with those kinds of issues all the time. Glad you got it working :)
Great tutorials! O really like how fast you do it, feels like every second is worth it! Subscribed!
@@kyonru what was your issue, i'm currently experiencing the same problem...
@@yerbavore You need to enable depth buffer on your pipeline asset!
Nice
Is there a way to use this in Unreal?
As far as I'm aware, there's no magic way to directly convert Unity shader graphs into Unreal materials. However, the Unreal material editor is fairly similar to Unity's shader graph editor, so it'll have similar nodes to work with. It's been a while since I touched Unreal, but I'd wager it wouldn't take a million years to do the conversion by hand (although you might face difficulty when you get to the part about using eye depth to calculate intersection foam, Unreal probably has a different system for this).
As a side note, I'd love to put out tutorials for other engines in the future, although that will take A LONG time.
@@danielilett Thanks for the succinct answer, I wish it wasn't kind of over my head still, but that is a failing on my part to understand, such is the life of a game dev.
Great video but it's annoying to try to follow along in places where your video is moving slower than your narration. Such as 2:35
hehe control + paste go brrrr
ah, classic.
First time i need to play at 0,5 speed.
i wonder if this can also work in roblox studios
that would be GREAT
i watched the entire video, and its probably not going to work
Who also came from Dani?
Who’s here from Dani
What the fuck kind of black magic did I just witness.
Hi, great tutorial, thank you for sharing! Maybe you know how to make this effect?: th-cam.com/video/Z1Xkw9fyp_k/w-d-xo.html
Your channel have great tutorials, but your video's thumbnails kinda feel bland.
I think you need to improve that :)
hope you the best luck.
I've toyed around with a couple of designs already and when I think up something more exciting, I go back and update all of them. For now I think they're fine but inevitably I'll change my mind and update them sometime in the future! But might be helpful to know, what parts of them feel bland in particular to you?