you can put the shader in your own folder by clicking the gray text that says "shader graphs" in the shader blackboard. you can subdivide the sections by using a slash. "zakkaioken/farm" will put the shader in that folder in that menu. This is in relation to your question at 4:53
Also a quick note: There is no Grab Pass in HDRP, but in your HD/Lit Master Node under Settings, you can select "Refraction Model" and set it to Sphere for example. Then you can control the refraction index. Set it to something like 0.99. Still figuring out how to properly do refraction in HDRP combined with Depth Blending though, because that seems to hide the refraction.
"as usual if you have any questions or concerns, you can just keep them to yourself" this cracked me up hahaha PS: I appreciate your effort to keep doing Shader Graph tutorial, but man the limitation of that tool is just so frustrating, it baffles me how Unity is giving it a 7.x versioning when the tool is clearly still in "early access" phase and lacking so many fundamentals features. On a better note, please consider making a full Intermediate/Advanced Amplify premium course, something in the range of ~$100 , the chapters will be a "case-study" of famous/common Shader Technics used in popular games that are more advanced than the ones you see on youtube, for example one of the main puzzle that i still can't find an answer of is this: In a game like Red Dead 2, where the character model (clothes & skin) get so many effect thrown at (mud, snow, blood, damage, etc..) , are these Individual shaders that can be "stacked" on top of each other ? or did they make one big massive shader with tons of settings to change at runtime ? But back to the case-study, you remember the original Splinter Cell and his 3 googles (night, thermal and EMF vision) ? can we have a tutorial for that please ♥
That is a big big question, ill have to get back to you on basically all of that. The short answer is, yeah, character shaders (especially hero characters) are allowed to be pretty crazy! But, stacking shaders is certainly possible too, unity can do it by default, just tell unity that your character has more materials than it actually has.
You can fix the refraction getting colors from stuff outside the water by using the difference between the screen depth (sampled using the refracted UVs, in eye-space) and the surface depth (in Eye-space), using that to determine whether or not a vertex is outside the water (less than 0, out of water) and masking the refraction UV with it. Thanks for the videos.
Interesting, with nodes alone? I have proper refraction on one of my waters (somewhere) but it uses some code, and that part was made by someone smarter than me!
@@PolyToots I'm currently porting it to ShaderGraph from the working version I made in Amplify but it's mostly just linear algebra just using the Screen Depth (depth texture) and surface depth nodes (that can be replaced by Distance(vertex position, camera position) but the trick is to to use the already refracted UVs as the 'Pos' input on the Screen Depth node). As you know very well, this stuff on ShaderGraph is extra complicated so I'll report back soon. Thanks
Oh you've got a version of it in ASE? That is pretty dope! Definitely keen to learn more about your progress. Are you on the amplify discord or anything?
@@PolyToots yea, I double-checked your vid and it was only 4 months ago. But in the new Lit Shader I don't see the alpha channel or the conclusion channel :( God is this all confusing
Im thinking hard if i should buy Amplify or just wait for Shader Graph to be developed further, what is your opinion on that? Will Shadergraph pass Amplify / is it worth grabbing Amplify?
@@cerzix Every shader expert i know recommends Amplify, also, you heard it here first, Shader graph will never catch up on Amplify and they will eventually either acquire Amplify, or drop it and re-do it, kinda like they are doing to their UGUI now with the introduction of the new CSS-like tool.
I don't know what the future holds, but I will say with (a good amount of) certainty that for as long as amplify shader editor is a paid product, you can pretty much guarantee that it will be better.
@@PolyToots I really appreciate the reply and will look into how i can fit amplify into my financial planning 😂 Keep up the amazing content as always 👍
This is probably not going to happen, at-least not a conversion of the amplify tutorial I had done. It's a complex node set-up even with amplify, so with shader graph it would be an absolute nightmare. Complete spaghetti.
Awesome tutorial! I wish I had this two weeks ago of course! I ran into similar problems with edge foam and glitches on palm trees - part of the problem was the opaque texture; I saw a lot of this in VR rendering (not in Multiview). I fixed part of it my cranking the MSAA and lowering the render scale to 0.8 (which is not exciting). Another fix I tried was to add randomized sea-foam which blended at the edges instead.
@@PolyToots Two weeks ago I was following your other Ocean shader tutorials (along with some others). But the look on this one with the refraction is amazing!
To fix the issue of how fast and hard it is to set the depth values, set the vector 1 or now float to max 2 instead of 1 or more. Also, change the mode to slider in the node settings.
Hi, im new with shader graph. I cant find the scene color node. Are there different versions of shader graph? In input / scene there is no color node. PLease help me
Thanks for sharing these helpful knowledge! I did a quick test on a flat surface and it works really well. But when I try to create a river modeling with bumpy surfaces, waterfalls... it's become a flat surface when I apply the ShaderGraph. I found out that when I disconnect the "Displacement" group, it restores my original model. Can you help me to solve this problem
after making the displacement nodes my displacement is not working the right way, it is displaced in the Z axis instead of the Y, i think because my plane is vertical when i imported it, what should i change?
It does support tesselation for HDRP. URP does not natively support Tessellation they considered it non optimal... as they have done with other features too...
The refraction part isn't working for me. I even imported the shader you've provided on patreon and the refraction doesn't work either in my project, as well as the white borders where the objects are (they don't appear). Do you have any idea why this is happening? I’m using a newer version of Unity, and if this is the problem, do you know how to solve it?
Can you make a similar tutorial for this on unity HDRP? I tried to import this shader graph in a hdrp project but the transparency doesnt work quite well
Finally I made a sea. Thanks for the fantastic video. :) I have a question, im my scene right next to the sea I have a river that flows into the sea, they are 2 different objects with different shaders. Is there any way to soften or smooth the area where the sea and the river touch each other (delta river)? Using shader graph of course.Thanks.
My man PolyToots, you are literally the one im following about shader, you are great. But i have one question for you, it's not the first time scene color node is not workign in the albedo as it is supposed to. In the URP it works like you are planning, but in HDRP it doesnt. Transparency acts in different ways in HDRP. Do you have any clue?
Ok i discover what happened here. HDRP doesn't show your the rendere queue by default, it was layer 2000. On the material, on the 3dots you have to click and check the Debug window instead of the default, so you can sort properly the rendere queue of the material, put 3000, then switch back to default.
For 90% of the cases, you only need to change something if you're importing a shader from one pipeline to another. So if you grab the shader from my patreon (free) and import it into a URP project, it will work (provided you have the same URP settings like the depth and opaque textures enabled). Other than that, if you're creating a shader in HDRP and just following a tutorial in URP (or vice-versa, or built-in/legacy) then it will most likely work fine. Since you're creating it in the pipeline you're already in.
Thanks for the tutorial. I followed it to the letter, but the refraction doesn't work. I either see a transparent gray object (no texture), or if I enable "opaque textures" on the URP Asset settings (as recomended elsewhere) I see the texture, but no refraction. Maybe they changed something in the latest Unity release?
by "as recommended elsewhere" do you mean @ 1:52 in the tutorial? If you're seeing "through" the object then it sounds like the grab pass is working just fine, so make sure your normal map is setup in the shader to act as distortion, and also that the value you're distorting it by is greater than 1. If you want to know for sure if something has broken, you can download the shader from this tutorial on my patreon (free) and see for yourself.
I think depth distance at about 9:30 should have been a divide after the subtract not a multiple of the screen position (I legit don't even know how that worked) as you're wanting to scale 0...x>1 (pre saturate) down into the 0...1 range, extending the 'range' the depth mask covers.
I have no idea how you guys got this to work, it doesnt work whatsoever for me, and im using hdrp, but I also cant find the setting in my hdrp asset to turn on depth
ah hdrp is a different beast entirely, It handles depth/opacity a lot different if I remember correctly. I haven't actually done any water shaders in hdrp yet for this reason. I can't help you out unfortunately but I hope to include some HDRP-compatible tutorials in the future.
@@PolyToots Ok. Can you create a tutorial for HDRP water? Water for my game is the main thing that im missing, and there are NO tutorials whatsoever on water in HDRP :(
hi, so I use 2020 version but somewhat it doesn't work. really not sure, but is it something to do with usage of base color instead of albedo (well, it's almost same thing)
Not sure if you get this, but if you zoom out a bit, does ocean floor come out as if it was a shallow part of a shore? I think it's something wrong with the Depth Distance and Strength not interacting so well with more distant camera positions.
Veery smooth tutorial. Great work. The music is fine btw in my opinion :D Will you do a foam and edge highlight tutorial as well? I've already watched the ones you do with Amplify; but I'm unable to convert it to Shader Graph as I'm pretty sure a lot of people also had the some trouble. It'd be extremely useful. Like your tutorials :D
Yeah blender, though the plane can be made anywhere of course, buuuut blenders ocean modifier is where I got the displacement map from. I'll be covering it again in my next tutorial, this time using animated displacement! (so not panning a static texture)
I did your tutorial and then after Ive finished it didnt look anything like yours, then I donwloaded your package to see if I did something wrong, but it seems that in current versions of the unity this doesnt work as intended any more and I dont know why... please come back!
Hi! Thanks for the tutorial! QQ, the enabling depth checkbox in render pipeline settings... Is it possible to achieve this kind of effect in standard RP and amplify shader editor? I wanted to use it to make waves taking into account island's perimeter but don't know how to do that in ASE. Thanks again for the tutorials! You are awesome!
Yes the standard RP you don't need to enable any of that stuff, it just works! Your shader will need to be set to transparent still though. For the waves based on perimeter, it's an interesting question, but not one I've solved yet.
@@PolyToots Thanks for answering!! A friend of mine found this method, but I just don't know how to translate it into an actual shader. www.reddit.com/r/proceduralgeneration/comments/gmkyg1/a_method_for_rendering_shore_waves/? Hope you find it interesting!
Can you explain how I import this in urp? I import it but it cant find the materials. There is only the obj file in the source folder and images in the texture folder
@@PolyToots I am not sure what you mean. I am talking just about the walrus cave model from sketch fab. When I downloaded the obj type, I just got the model and no materials
@@anonymoussloth6687 When you say no materials do you mean no textures? Materials are specific to Unity (in this case) so you're not going to get them from sketchfab, you'll need to create a material in unity and assign the walrus textures to them. The walrus model isn't mine so if the textures aren't downloading then it's either a problem with sketchfab or the author has disabled them.
@@PolyToots yes there were no materials and textures. Just the obj file with the 3d model. Once I unzipped the file, it had 2 folders, source and textures. The textures folder was empty and the source folder just had the obj file
can you please explain why we need to multiply camera far plane with depth value and what subtraction of screen position A value gives us? (I am not to strong in this calculations). thanks!
The camera far plane and screen position is just to calculate the "depth" of the scene from the angle of the camera, as this is the users perspective it wouldn't make sense to get depth from a different angle. We need the depth value simply to determine the strength/distance of the depth. Imagine it has just grabbing the cameras "forward" vector, and using that to generate a greyscale depth mask of the entire screen.
Thank you for the tutorial, this has been a great base shader to build upon. That being said, one thing I've been struggling to add to it is planar reflections - I can't seem to find a good tutorial on planar reflections anywhere. The closest I've gotten is trying to rip the reflections from Unity's own 'Boat Attack' scene, but that attempt failed spectacularly. Is there any chance you could do a tutorial on planar reflections in general?
Shaders for now, I will be mixing in 3d game art with in the future. You don't need to become my patreon for the files though. It's all free. Patreon membership is to support the channel in general.
Then you have absolutely all videos accesible without membership? wow, thats nice, I wouldnt do that but thats very nice of you haha. Actually this is what im looking for, a person that is focused on this topic only
Oh, and one thing I wanted to cover in this tutorial but didn't have the time for, is there is a free asset on the unity store called "Deformer" which might interest you. It's not related to buoyancy, but deformations when objects move through the water: assetstore.unity.com/packages/tools/modeling/deform-148425
I get this question a lot, and it's always so tricky to answer. Context is very, very important. Because this will work on mobile just fine, but if it's not an important asset then you can always go cheaper. But if you need some basic waves this is about as cheap as it gets, and if you don't need the refraction, then simply don't use that part of the shader.
Please tell us how you got the normal map (or maybe a link to a tutorial or something), because it seems to be really not as simple... at least not for me :S
I won't go over the ocean modifier stuff as I think that's simple enough, but here's how you get the normal map from it: ua-cam.com/video/oly17M9eYfk/v-deo.html and here's how you can get the height map: ua-cam.com/video/arvhK4tvYuY/v-deo.html
Hey, sorry if I didn't mention it in the video, but I used Blender's "Ocean" modifier. Worth checking out for sure. I'll be covering this in my next video with a bit more detail.
Can you please do something like wet mud in the shader graph? I have been trying to do it but I just can't figure it out. by wet mud, I mean something that you would find on a dirt road after a rain.
@@PolyToots Something that looks like mud actually. I wanted to place these muds on roads. So the muds puddles won't have much depth to them so it doesn't need to behave like mud.
@@PolyToots Why not both? Seems like a cool effect to do to be honest. Something like mud isn't hard in itself, but the behaviour of mud with the visual effect seems awesome.
Not with shader graph unfortunately, though I haven't had another crack at it since I did this tutorial. We've got proper depth sorted refraction with Amplify now (seen in this tutorial: ua-cam.com/video/zD6GV6bZenM/v-deo.html) but like I said, not tried with SG again yet.
I am also not 100% sure of this, but even if it's not in yet, it definitely will be at some point. And hopefully with distance based tessellation built in by default too!
@@PolyToots It seems there is currently no support for Tessellation in Shader Graph. You can vote for it here: portal.productboard.com/unity/1-unity-graphics/tabs/7-shader-graph
Hey man, to answer your other question about mobile: Yes it will work fine. I have no idea what "night water" is but this is essentially a surface with a smoothness value of 1, so if you're using reflection probes, or reflection probe nodes, or a screen space reflection post process, then it will of course reflect whatever is in your scene.
In my third person project, my player still got all refracted no matter under or above the water. I really cant find a solution for this , searching for like 4 days now.
I feel your frustration! My technique of using depth to mask out refraction only partially solves this issue. A commenter called Sai G (just scroll up, or down, I don't know how this works) has mentioned a possible fix, though I am unsure if this can be done with nodes alone.
No words about how to import the model to Unity? The model is not fbx, its some weird glTF Unity doesn't know about. There is Sketchfab for Unity 1.2.0 package on github but its bugged and import models with inverted polygons. Like I cant even follow this tutorial...
The cave model has nothing to do with the tutorial so I wouldn't worry about that. I grabbed it from sketchfab as a nice bit of visual context. It is not used in the shader creation at all.
@@PolyToots Well I understand it's not needed, but since you show it in the video + even say with a voice where you downloaded it + you give the link to it it's pretty obvious you want people to use it, don't you think? But now I've spend like an 1h+ and still don't have a working model in Unity, some polys are flipped using the Sketchfab Unity importer. It's obviously not your fault but it doesn't help either. It's like baiting, you can't just show a model, provide links and then be surprised when people actually want to use it :)
@@robosergTV Yes I have to say where I got it from, since I'm showcasing work that's not my own. I'm sorry you thought that was an instruction to download it, I'm just giving credit to an asset I used. If you use Blender at all, it will make working with sketchfab assets a lot easier. ua-cam.com/video/vi4AGvoQecA/v-deo.html
@@PolyToots I use 3ds max but I didn't want to manually go in and fix polygons by hand, it should not be needed in the first place. My argument was more in the lines of if you show a model, please spend 15 seconds to say how to import it, since sketchfab doesn't use fbx but some weird broken glTF format no one uses.
@@robosergTV You've stumbled across the answer as to why I can't do that. Lots of people use many different things, I cannot act as tech support for sketchfab quirks. I just credit where the artwork came from, if someone wants to use it that's on them. I use the blender add-on, but this would not have helped you even if I had mentioned it. I can't go adding 10 minutes onto every video to talk about how to import it in various software's. I'm sorry that sketchfab has a super bizarre format, but this is not something I can control.
When I add the displacement, the plane becomes smaller. What do I do? EDIT: Nevermind, I forgot to put the position node into object, not world. Great video though
so great tutorial !!! Im studying shader with Shader Forge, this video is usefull. I wanna know about the ocean texture,(Height and Normal) because there is no ocean texture tutorial, yours is the best quality Ive ever seen. Please tell me if you know any good references or youtube movies. Thank you! (my english is poor, sorry > < )
I was just really impressed with Blenders ocean modifier, so I used that to generate my height/normal. I have another video (not using shadergraph, but still using blender for the ocean). ua-cam.com/video/zD6GV6bZenM/v-deo.html In that video I am also capturing the animation which you don't need to do (so ignore the bits about animating time). But it does explain my process a bit more. Maybe it will help.
@@PolyToots Thank you for your reply. omg I didnt know we can get texture from blender's simulation!! thats very interesting!! I will get blender. Great movies, ultra thank you!
Looks great and better than most! Kudos. However, I'm looking for something that'll work in VR. Does this fit the bill? Anyone using this in VR? Thanks
Thanks! Can't be of much help with the VR stuff but other commenters have talked about it before on this and some of my other water tutorials, and it seems to be a mixed bag. I see people with issues and others who have similar shaders working fine. I don't have any VR gear at home but feel free to grab a download of this wateron my patreon and try it for yourself (I would also like to know if it works!) www.patreon.com/posts/39773235
@@PolyToots It works in VR, but not as depicted in the video. It could be I need to tweak the settings based on the size of my sub mesh. Let you know if I find the optimal setting. Unity version for those interested: 2020.1.8f1. Multi-Pass on Oculus Quest
So, about the foam I don't know if Unity changed something or not, but I followed the Gabriel Aguiar "Cartoon Water & Foam Shader" tutorial (for the foam part only), connected to the emission of the shader, and it worked. I could just be blind and not be seeing the small artifacts, but it seems perfect to me. Also, I did a small change to the shader, but I doubt it had any real impact. I changed the refraction to be CodinBlack's version, and I gave it its own "normal strength" vector, instead of using the same one from the "Normals" group. IMO, a high value for normal strength and a small value for the refraction's normal strength looked better. Either way, I don't think that impacted the foam or artifacting at all, but just leaving it here.
Excellent comment! Yeah I think your different refraction might have done it, I was thinking about it afterwards and I think I can avoid the the artefacts as well (they appear in game view only by the way), if I can manage to port my latest Amplify water into shadergraph (I did a very different setup for depth and refraction)
@@PolyToots Indeed, I checked the game view mostly, although I didn't check a build of the game. And ooh, if you ever manage to port that beautiful Amplify shader, I'd be very grateful. Saismirk worked some magic on those refractions. I saw some people talking about the "refracting things above water" problem, and the solutions are too much for my tiny brain =P Unfortunately I don't have Amplify, so I tried your two camera trick from a previous video, except I did one for underwater and one for everything above it. It does work and solves the refraction issue, but it's a LOT of work to get it working as intended and not render things in a bizarre order that messes with your head. Overall I'll stick with not enabling refractions for most of my water, and going the extra mile with the two cameras for some key shots, but I feel I'll just end up either buying Amplify or just hoping to eventually find a solution in shadergraph. Either way, I should also say this is by far the best water shader tutorial for shadergraph I've seen so far, and I've seen/read quite a few of them. So thanks for your hard work!
The normals map that yu provide on Patreon is not entirely seamless. Is it just us or is yours the same? The seams are extremely visible when the waves move.
What did you set your tiling amount to? As I mention in the tutorial, since we're using object UV's you need to use round numbers only because you can't tile an image by a half, or a ".3" you know? If you want more control over the scale, then go with world space UV's (my previous ocean shadergraph tutorial covers worldspace UV's)
Awesome tutorial brother. But is there anyone here who can point me in the right direction to understand why you are doing what you are doing coz I don't understand shit. I'm from a programming background and I can't do anything more than following the whole tutorial step by step. 😒 Great share btw.
This is probably not going to happen, at-least not a conversion of the amplify tutorial I had done. It's a complex node set-up even with amplify, so with shader graph it would be an absolute nightmare. Complete spaghetti.
@@sanovictus Ah right, yeah it's not called a "Cloud" one specifically, might be why. It's here: ua-cam.com/video/Ixt8GpfzFS8/v-deo.html. I am currently looking into a potentially better method for volumetric rendering though, I am not 100% happy with the results of that tutorial.
to make this work in VR you have to change the Scene Depth nodes Samplir from "Linear 001" into "eye" from the drop down menu
Good to know! I don't have any VR kit yet so I can never answer these things when people ask. Cheers man.
you can put the shader in your own folder by clicking the gray text that says "shader graphs" in the shader blackboard. you can subdivide the sections by using a slash. "zakkaioken/farm" will put the shader in that folder in that menu. This is in relation to your question at 4:53
Out of curiosity, what are your thoughts on background music? Ditch it completely? Keep it? Stop looping happy piratey songs?
Music was fun... keep it
Maybe Turn Down The Volume a Little bit
remove because then people can't listen to their own tunes. no added value = no reason to keep
I liked it
Keep it. It helps with keeping attention and pace. Maybe if we are to nitpick, slightly, slightly slightly lower or if possible compress its peaks.
Also a quick note: There is no Grab Pass in HDRP, but in your HD/Lit Master Node under Settings, you can select "Refraction Model" and set it to Sphere for example. Then you can control the refraction index. Set it to something like 0.99. Still figuring out how to properly do refraction in HDRP combined with Depth Blending though, because that seems to hide the refraction.
Cheers man, I appreciate all the info.
"as usual if you have any questions or concerns, you can just keep them to yourself"
this cracked me up hahaha
PS:
I appreciate your effort to keep doing Shader Graph tutorial, but man the limitation of that tool is just so frustrating, it baffles me how Unity is giving it a 7.x versioning when the tool is clearly still in "early access" phase and lacking so many fundamentals features.
On a better note, please consider making a full Intermediate/Advanced Amplify premium course, something in the range of ~$100 , the chapters will be a "case-study" of famous/common Shader Technics used in popular games that are more advanced than the ones you see on youtube, for example one of the main puzzle that i still can't find an answer of is this:
In a game like Red Dead 2, where the character model (clothes & skin) get so many effect thrown at (mud, snow, blood, damage, etc..) , are these Individual shaders that can be "stacked" on top of each other ? or did they make one big massive shader with tons of settings to change at runtime ?
But back to the case-study, you remember the original Splinter Cell and his 3 googles (night, thermal and EMF vision) ? can we have a tutorial for that please ♥
That is a big big question, ill have to get back to you on basically all of that. The short answer is, yeah, character shaders (especially hero characters) are allowed to be pretty crazy! But, stacking shaders is certainly possible too, unity can do it by default, just tell unity that your character has more materials than it actually has.
Thank you so much man, glad you are around.
You can fix the refraction getting colors from stuff outside the water by using the difference between the screen depth (sampled using the refracted UVs, in eye-space) and the surface depth (in Eye-space), using that to determine whether or not a vertex is outside the water (less than 0, out of water) and masking the refraction UV with it. Thanks for the videos.
Interesting, with nodes alone? I have proper refraction on one of my waters (somewhere) but it uses some code, and that part was made by someone smarter than me!
@@PolyToots I'm currently porting it to ShaderGraph from the working version I made in Amplify but it's mostly just linear algebra just using the Screen Depth (depth texture) and surface depth nodes (that can be replaced by Distance(vertex position, camera position) but the trick is to to use the already refracted UVs as the 'Pos' input on the Screen Depth node). As you know very well, this stuff on ShaderGraph is extra complicated so I'll report back soon. Thanks
Oh you've got a version of it in ASE? That is pretty dope! Definitely keen to learn more about your progress. Are you on the amplify discord or anything?
@@PolyToots Yes, I am on the ASE Discord.
@@Bankoru do you find a solution for shader graph?
Where all the shader properties are stored: double click where it says "Shader Graphs" to change the folder it goes into ;)
is URP-> "Lit Shader Graph" the same thing as PBR Graph? I cant find that PBR Graph as in 2021
Yeah, looks like it's that way in 2020.2 as well. They must have changed it literally in the next version after this tutorial was done.
@@PolyToots yea, I double-checked your vid and it was only 4 months ago. But in the new Lit Shader I don't see the alpha channel or the conclusion channel :( God is this all confusing
Haven't watched this yet but already so excited to try. Always love your tutorials!
Can't wait to hear how much I disappointed you Tyler.
How yo make this work on Webgl? all the reflections and bloom have been lost...
Neat cant wait for the Amplify tutorial, great work as always!
Im thinking hard if i should buy Amplify or just wait for Shader Graph to be developed further, what is your opinion on that? Will Shadergraph pass Amplify / is it worth grabbing Amplify?
@@cerzix Every shader expert i know recommends Amplify, also, you heard it here first, Shader graph will never catch up on Amplify and they will eventually either acquire Amplify, or drop it and re-do it, kinda like they are doing to their UGUI now with the introduction of the new CSS-like tool.
I don't know what the future holds, but I will say with (a good amount of) certainty that for as long as amplify shader editor is a paid product, you can pretty much guarantee that it will be better.
@@PolyToots I really appreciate the reply and will look into how i can fit amplify into my financial planning 😂
Keep up the amazing content as always 👍
If you're still new to shaders I wouldn't worry about it really. Use shadergraph until you realise you need a bigger boat.
Worth noting that PBR Master appears to not exist anymore? I can't find it, I see plenty of other shaders though.
please do a volumetric clouds in Unity Shader Graph....
This is probably not going to happen, at-least not a conversion of the amplify tutorial I had done. It's a complex node set-up even with amplify, so with shader graph it would be an absolute nightmare. Complete spaghetti.
at 15:30 you can round/ceil/floor numbers to lock them to a integer scale. they're in the math nodes section in the add nodes menu
Very cool man this looks great.
Those white-lines at 14:51 can be fixed by configuring mip-maps in the texture itself I believe. Great tutorial!
Hi, why does my vector 3 node can't be paired with vertex position just like in 22:23?
Awesome tutorial! I wish I had this two weeks ago of course! I ran into similar problems with edge foam and glitches on palm trees - part of the problem was the opaque texture; I saw a lot of this in VR rendering (not in Multiview). I fixed part of it my cranking the MSAA and lowering the render scale to 0.8 (which is not exciting). Another fix I tried was to add randomized sea-foam which blended at the edges instead.
Interesting info for sure. Thanks man. Edit, and wait, what was happening 2 weeks ago!?
@@PolyToots Two weeks ago I was following your other Ocean shader tutorials (along with some others). But the look on this one with the refraction is amazing!
Amazing content!
To fix the issue of how fast and hard it is to set the depth values, set the vector 1 or now float to max 2 instead of 1 or more. Also, change the mode to slider in the node settings.
Im nearning unity right now, i come from unreal engine, the nodes looks very similar! it seems interesting! finally unity got the nodes
Dude the amount that you tell at yourself kills me !
how can i make the plane into a circle with an alpha gradient at the borders? to make a nice diorama
Hi, im new with shader graph. I cant find the scene color node. Are there different versions of shader graph? In input / scene there is no color node. PLease help me
Thanks for sharing these helpful knowledge!
I did a quick test on a flat surface and it works really well.
But when I try to create a river modeling with bumpy surfaces, waterfalls... it's become a flat surface when I apply the ShaderGraph.
I found out that when I disconnect the "Displacement" group, it restores my original model.
Can you help me to solve this problem
Nice video ! I have the same problem of the small white outline...
after making the displacement nodes my displacement is not working the right way, it is displaced in the Z axis instead of the Y, i think because my plane is vertical when i imported it, what should i change?
Refraction isn't working in HDRP, either the transparent material stays opaque black or the whole scene view is blown out with white. Any ideas?
It does support tesselation for HDRP. URP does not natively support Tessellation they considered it non optimal... as they have done with other features too...
The refraction part isn't working for me. I even imported the shader you've provided on patreon and the refraction doesn't work either in my project, as well as the white borders where the objects are (they don't appear). Do you have any idea why this is happening? I’m using a newer version of Unity, and if this is the problem, do you know how to solve it?
Can you make a similar tutorial for this on unity HDRP? I tried to import this shader graph in a hdrp project but the transparency doesnt work quite well
Same.
@@readyforlol same
Thanks a lot for great tutorial. Which tutorial is showing to convert uv ObjectPosition to WorldPosition ? Can you give a link or video name ?
Is there a way to stop the waves from stretching when i scale the ocean plane?
Im trying to get this shader to work with some procderally generated meshes. Are there any changes i can make so this will work?
where can i get normal map?
How do I get an exact wave height at certain position?
Awesome. Looking forward to the ASE version.
Finally I made a sea. Thanks for the fantastic video. :) I have a question, im my scene right next to the sea I have a river that flows into the sea, they are 2 different objects with different shaders. Is there any way to soften or smooth the area where the sea and the river touch each other (delta river)? Using shader graph of course.Thanks.
My man PolyToots, you are literally the one im following about shader, you are great. But i have one question for you, it's not the first time scene color node is not workign in the albedo as it is supposed to. In the URP it works like you are planning, but in HDRP it doesnt. Transparency acts in different ways in HDRP. Do you have any clue?
Ok i discover what happened here. HDRP doesn't show your the rendere queue by default, it was layer 2000. On the material, on the 3dots you have to click and check the Debug window instead of the default, so you can sort properly the rendere queue of the material, put 3000, then switch back to default.
It was beautiful. Thank you very much. Now my game is nicer. Thank you so.
Can i use in BuiltIN shaders ? or i need URP
Does this work with URP of HDRP?
EDIT: I saw you confirmed it does, but is there anything we need to change to get it working
For 90% of the cases, you only need to change something if you're importing a shader from one pipeline to another. So if you grab the shader from my patreon (free) and import it into a URP project, it will work (provided you have the same URP settings like the depth and opaque textures enabled). Other than that, if you're creating a shader in HDRP and just following a tutorial in URP (or vice-versa, or built-in/legacy) then it will most likely work fine. Since you're creating it in the pipeline you're already in.
hello , i made the water , now i want to make water caustic . Can you make a video that teaches this? thanks.
Thanks for the tutorial. I followed it to the letter, but the refraction doesn't work. I either see a transparent gray object (no texture), or if I enable "opaque textures" on the URP Asset settings (as recomended elsewhere) I see the texture, but no refraction. Maybe they changed something in the latest Unity release?
by "as recommended elsewhere" do you mean @ 1:52 in the tutorial? If you're seeing "through" the object then it sounds like the grab pass is working just fine, so make sure your normal map is setup in the shader to act as distortion, and also that the value you're distorting it by is greater than 1. If you want to know for sure if something has broken, you can download the shader from this tutorial on my patreon (free) and see for yourself.
I think depth distance at about 9:30 should have been a divide after the subtract not a multiple of the screen position (I legit don't even know how that worked) as you're wanting to scale 0...x>1 (pre saturate) down into the 0...1 range, extending the 'range' the depth mask covers.
This is correct! Fixes the distance calculation to the intended result, Got to this and water is looking great :)
this ocean works for a mobile devices? and how put some real reflexions of the environment?
where can i find the texture and normal map you are using?
Patreon my dude, check this post for the Unity package (URP)
www.patreon.com/posts/ocean-shader-urp-39773235
rully cooooool
I havn't find the PBR Graph
I have no idea how you guys got this to work, it doesnt work whatsoever for me, and im using hdrp, but I also cant find the setting in my hdrp asset to turn on depth
ah hdrp is a different beast entirely, It handles depth/opacity a lot different if I remember correctly. I haven't actually done any water shaders in hdrp yet for this reason. I can't help you out unfortunately but I hope to include some HDRP-compatible tutorials in the future.
@@PolyToots Ok. Can you create a tutorial for HDRP water? Water for my game is the main thing that im missing, and there are NO tutorials whatsoever on water in HDRP :(
hi, so I use 2020 version but somewhat it doesn't work. really not sure, but is it something to do with usage of base color instead of albedo (well, it's almost same thing)
Hey, if you download the package from patreon do you get the same issues? www.patreon.com/posts/39773235
@@PolyToots different issue, it's appear pink. I think something to do with the renderer compatibility (already use URP tho)
@@PolyToots anyway I try my nodes on HDRP it's working. but still not work on URP it's grey
Not sure if you get this, but if you zoom out a bit, does ocean floor come out as if it was a shallow part of a shore? I think it's something wrong with the Depth Distance and Strength not interacting so well with more distant camera positions.
Yup, I mention this in the video that the behaviour seems very strange with shadergraph.
PolyToots Aah you probably did. I’ll see if I can give it a shot to see why it happens. Thanks!
Bro can u make a ryu's Hadouken tutorial? u rocks man.
Veery smooth tutorial. Great work. The music is fine btw in my opinion :D Will you do a foam and edge highlight tutorial as well? I've already watched the ones you do with Amplify; but I'm unable to convert it to Shader Graph as I'm pretty sure a lot of people also had the some trouble. It'd be extremely useful. Like your tutorials :D
Yeah for sure, like I show at 24:28 I had some issues with it in URP, super odd results. Need to find out why.
Really dumb question from a really dumb person: how do you get that plane and the normal/height maps? Blender?
Yeah blender, though the plane can be made anywhere of course, buuuut blenders ocean modifier is where I got the displacement map from. I'll be covering it again in my next tutorial, this time using animated displacement! (so not panning a static texture)
@@PolyToots Can't wait!
I did your tutorial and then after Ive finished it didnt look anything like yours, then I donwloaded your package to see if I did something wrong, but it seems that in current versions of the unity this doesnt work as intended any more and I dont know why... please come back!
Hey matey, what version of unity and which rendering pipeline are you on?
Hi! Thanks for the tutorial!
QQ, the enabling depth checkbox in render pipeline settings... Is it possible to achieve this kind of effect in standard RP and amplify shader editor?
I wanted to use it to make waves taking into account island's perimeter but don't know how to do that in ASE.
Thanks again for the tutorials! You are awesome!
Yes the standard RP you don't need to enable any of that stuff, it just works! Your shader will need to be set to transparent still though. For the waves based on perimeter, it's an interesting question, but not one I've solved yet.
@@PolyToots Thanks for answering!!
A friend of mine found this method, but I just don't know how to translate it into an actual shader.
www.reddit.com/r/proceduralgeneration/comments/gmkyg1/a_method_for_rendering_shore_waves/?
Hope you find it interesting!
@@serj_1264 I think I know what that is without clicking it. Someone else in the comments has mentioned it as well. It is interesting.
Can you explain how I import this in urp? I import it but it cant find the materials. There is only the obj file in the source folder and images in the texture folder
Are you adding the unitypackage file? Or adding the files (shader/textures) manually?
@@PolyToots I am not sure what you mean. I am talking just about the walrus cave model from sketch fab. When I downloaded the obj type, I just got the model and no materials
@@anonymoussloth6687 When you say no materials do you mean no textures? Materials are specific to Unity (in this case) so you're not going to get them from sketchfab, you'll need to create a material in unity and assign the walrus textures to them. The walrus model isn't mine so if the textures aren't downloading then it's either a problem with sketchfab or the author has disabled them.
@@PolyToots yes there were no materials and textures. Just the obj file with the 3d model. Once I unzipped the file, it had 2 folders, source and textures. The textures folder was empty and the source folder just had the obj file
can you please explain why we need to multiply camera far plane with depth value and what subtraction of screen position A value gives us? (I am not to strong in this calculations). thanks!
The camera far plane and screen position is just to calculate the "depth" of the scene from the angle of the camera, as this is the users perspective it wouldn't make sense to get depth from a different angle. We need the depth value simply to determine the strength/distance of the depth.
Imagine it has just grabbing the cameras "forward" vector, and using that to generate a greyscale depth mask of the entire screen.
@@PolyToots thanks
Thank you for the tutorial, this has been a great base shader to build upon. That being said, one thing I've been struggling to add to it is planar reflections - I can't seem to find a good tutorial on planar reflections anywhere. The closest I've gotten is trying to rip the reflections from Unity's own 'Boat Attack' scene, but that attempt failed spectacularly. Is there any chance you could do a tutorial on planar reflections in general?
sorry, probably a noob question but I can't find the PBR graph, do I need an addon?
Yeah, if you go to the package manager you should see Shader Graph.
Thankyou!
Like and subsribe always for a problem solved
sorry im super confused, where did he get the height and normal map from ?
Made them with blender ocean modifier. (not animated, just a static ocean turned to textures.)
For anyone struggling with LWRP, set the depth texture and opaque texture using the LWRP Asset in the project assets.
You mean the bit at 1:50? Also this tutorial was made using URP, which is the LWRP, Unity just renamed it.
@@PolyToots This tutorial is great but for using LWRP instead of the newer URP, you have to do that step slightly differently.
Hello im interested in your patreon but I would like to know if its mostly foccused on shaders or other things
Shaders for now, I will be mixing in 3d game art with in the future. You don't need to become my patreon for the files though. It's all free. Patreon membership is to support the channel in general.
Then you have absolutely all videos accesible without membership? wow, thats nice, I wouldnt do that but thats very nice of you haha.
Actually this is what im looking for, a person that is focused on this topic only
@@PolyToots The problem is, now with the new system (fragment / vertex or something like that)everything is different, i think
I loved it
the water is green, but i told it to be blue, i think something's wrong, please help!
EDIT: don't worry, i was missing a node, problem solved!
Is there a way that you update this Tutorial with a Interacable "Version"? So my Object(s) can interact with the water?
That's out of the scope of this tutorial, but I mention in the description that what you want is something called a buoyancy script.
Oh, and one thing I wanted to cover in this tutorial but didn't have the time for, is there is a free asset on the unity store called "Deformer" which might interest you. It's not related to buoyancy, but deformations when objects move through the water: assetstore.unity.com/packages/tools/modeling/deform-148425
@@PolyToots Thank you very much!!
I am sorry, what about performance of such shader on a mobiles device?
I get this question a lot, and it's always so tricky to answer. Context is very, very important. Because this will work on mobile just fine, but if it's not an important asset then you can always go cheaper. But if you need some basic waves this is about as cheap as it gets, and if you don't need the refraction, then simply don't use that part of the shader.
Please tell us how you got the normal map (or maybe a link to a tutorial or something), because it seems to be really not as simple... at least not for me :S
I won't go over the ocean modifier stuff as I think that's simple enough, but here's how you get the normal map from it: ua-cam.com/video/oly17M9eYfk/v-deo.html and here's how you can get the height map: ua-cam.com/video/arvhK4tvYuY/v-deo.html
how do you get that normal map? can you generate the normal map in unity or do you need to find it else where?
Hey, sorry if I didn't mention it in the video, but I used Blender's "Ocean" modifier. Worth checking out for sure. I'll be covering this in my next video with a bit more detail.
@@PolyToots ahh ok, looking forward to your next video :)))
Can you please do something like wet mud in the shader graph? I have been trying to do it but I just can't figure it out. by wet mud, I mean something that you would find on a dirt road after a rain.
You mean something that looks like mud, or behaves like mud?
@@PolyToots Something that looks like mud actually. I wanted to place these muds on roads. So the muds puddles won't have much depth to them so it doesn't need to behave like mud.
@@PolyToots Why not both? Seems like a cool effect to do to be honest. Something like mud isn't hard in itself, but the behaviour of mud with the visual effect seems awesome.
Then I'm not sure this shader related to be honest, if you just want something to look like mud, then you need good mud textures!
@@PolyToots Oh, I see. Okay, I will check into that. Thanks for the info.
Great tutorial bro, and one more, i want a tutorial terrain shader triplanar in hdrp from you, hopelly😊
Hello mate, do you find a solution for refraction?
Not with shader graph unfortunately, though I haven't had another crack at it since I did this tutorial. We've got proper depth sorted refraction with Amplify now (seen in this tutorial: ua-cam.com/video/zD6GV6bZenM/v-deo.html) but like I said, not tried with SG again yet.
@@PolyToots thank you.
Great tutorial! Pretty sure HDRP supports Tessellation in Shader Graph, not 100% sure though.
I am also not 100% sure of this, but even if it's not in yet, it definitely will be at some point. And hopefully with distance based tessellation built in by default too!
@@PolyToots It seems there is currently no support for Tessellation in Shader Graph. You can vote for it here: portal.productboard.com/unity/1-unity-graphics/tabs/7-shader-graph
Bro love you 3000.
Nohomo
you dont have any tut for night water with real reflections! can do that? pleaaaase! :D
Hey man, to answer your other question about mobile: Yes it will work fine. I have no idea what "night water" is but this is essentially a surface with a smoothness value of 1, so if you're using reflection probes, or reflection probe nodes, or a screen space reflection post process, then it will of course reflect whatever is in your scene.
how to get subdivided plane?
where do I get the texture?
Awesome
Thanks a lot. Great video as always. Do you any ways to learn to write my own shader code?
Sadly no, my resources on that are limited but maybe a good place to look at is catlikecoding.com
In my third person project, my player still got all refracted no matter under or above the water. I really cant find a solution for this , searching for like 4 days now.
I feel your frustration! My technique of using depth to mask out refraction only partially solves this issue. A commenter called Sai G (just scroll up, or down, I don't know how this works) has mentioned a possible fix, though I am unsure if this can be done with nodes alone.
@@PolyToots i think ill give up on refraction for now.
I've said the same myself, but you can never truly give up on refraction.
Is it optimized for phones?
No words about how to import the model to Unity? The model is not fbx, its some weird glTF Unity doesn't know about. There is Sketchfab for Unity 1.2.0 package on github but its bugged and import models with inverted polygons. Like I cant even follow this tutorial...
The cave model has nothing to do with the tutorial so I wouldn't worry about that. I grabbed it from sketchfab as a nice bit of visual context. It is not used in the shader creation at all.
@@PolyToots Well I understand it's not needed, but since you show it in the video + even say with a voice where you downloaded it + you give the link to it it's pretty obvious you want people to use it, don't you think? But now I've spend like an 1h+ and still don't have a working model in Unity, some polys are flipped using the Sketchfab Unity importer. It's obviously not your fault but it doesn't help either. It's like baiting, you can't just show a model, provide links and then be surprised when people actually want to use it :)
@@robosergTV Yes I have to say where I got it from, since I'm showcasing work that's not my own. I'm sorry you thought that was an instruction to download it, I'm just giving credit to an asset I used.
If you use Blender at all, it will make working with sketchfab assets a lot easier.
ua-cam.com/video/vi4AGvoQecA/v-deo.html
@@PolyToots I use 3ds max but I didn't want to manually go in and fix polygons by hand, it should not be needed in the first place. My argument was more in the lines of if you show a model, please spend 15 seconds to say how to import it, since sketchfab doesn't use fbx but some weird broken glTF format no one uses.
@@robosergTV You've stumbled across the answer as to why I can't do that. Lots of people use many different things, I cannot act as tech support for sketchfab quirks. I just credit where the artwork came from, if someone wants to use it that's on them. I use the blender add-on, but this would not have helped you even if I had mentioned it. I can't go adding 10 minutes onto every video to talk about how to import it in various software's.
I'm sorry that sketchfab has a super bizarre format, but this is not something I can control.
When I add the displacement, the plane becomes smaller. What do I do?
EDIT: Nevermind, I forgot to put the position node into object, not world.
Great video though
Glad you got it sorted!
so great tutorial !!! Im studying shader with Shader Forge, this video is usefull.
I wanna know about the ocean texture,(Height and Normal)
because there is no ocean texture tutorial, yours is the best quality Ive ever seen.
Please tell me if you know any good references or youtube movies.
Thank you!
(my english is poor, sorry > < )
I was just really impressed with Blenders ocean modifier, so I used that to generate my height/normal. I have another video (not using shadergraph, but still using blender for the ocean). ua-cam.com/video/zD6GV6bZenM/v-deo.html In that video I am also capturing the animation which you don't need to do (so ignore the bits about animating time). But it does explain my process a bit more. Maybe it will help.
@@PolyToots Thank you for your reply.
omg I didnt know we can get texture from blender's simulation!! thats very interesting!! I will get blender.
Great movies, ultra thank you!
Looks great and better than most! Kudos. However, I'm looking for something that'll work in VR. Does this fit the bill? Anyone using this in VR? Thanks
Thanks! Can't be of much help with the VR stuff but other commenters have talked about it before on this and some of my other water tutorials, and it seems to be a mixed bag. I see people with issues and others who have similar shaders working fine. I don't have any VR gear at home but feel free to grab a download of this wateron my patreon and try it for yourself (I would also like to know if it works!) www.patreon.com/posts/39773235
@@PolyToots It works in VR, but not as depicted in the video. It could be I need to tweak the settings based on the size of my sub mesh. Let you know if I find the optimal setting. Unity version for those interested: 2020.1.8f1. Multi-Pass on Oculus Quest
Urp or HDR?
Fucking awesome thank you :D
So, about the foam
I don't know if Unity changed something or not, but I followed the Gabriel Aguiar "Cartoon Water & Foam Shader" tutorial (for the foam part only), connected to the emission of the shader, and it worked. I could just be blind and not be seeing the small artifacts, but it seems perfect to me.
Also, I did a small change to the shader, but I doubt it had any real impact. I changed the refraction to be CodinBlack's version, and I gave it its own "normal strength" vector, instead of using the same one from the "Normals" group. IMO, a high value for normal strength and a small value for the refraction's normal strength looked better. Either way, I don't think that impacted the foam or artifacting at all, but just leaving it here.
Excellent comment! Yeah I think your different refraction might have done it, I was thinking about it afterwards and I think I can avoid the the artefacts as well (they appear in game view only by the way), if I can manage to port my latest Amplify water into shadergraph (I did a very different setup for depth and refraction)
@@PolyToots Indeed, I checked the game view mostly, although I didn't check a build of the game. And ooh, if you ever manage to port that beautiful Amplify shader, I'd be very grateful. Saismirk worked some magic on those refractions. I saw some people talking about the "refracting things above water" problem, and the solutions are too much for my tiny brain =P
Unfortunately I don't have Amplify, so I tried your two camera trick from a previous video, except I did one for underwater and one for everything above it. It does work and solves the refraction issue, but it's a LOT of work to get it working as intended and not render things in a bizarre order that messes with your head.
Overall I'll stick with not enabling refractions for most of my water, and going the extra mile with the two cameras for some key shots, but I feel I'll just end up either buying Amplify or just hoping to eventually find a solution in shadergraph.
Either way, I should also say this is by far the best water shader tutorial for shadergraph I've seen so far, and I've seen/read quite a few of them. So thanks for your hard work!
bro where I can download normal map
Like I say in the video, everything is available for free on my patreon: www.patreon.com/posts/ocean-shader-urp-39773235
@@PolyToots thank you
PLZ TELL ME, it can works on 2019.4. try it 2days T.T
Yes, so long as you using Universal Render Pipeline
The normals map that yu provide on Patreon is not entirely seamless. Is it just us or is yours the same? The seams are extremely visible when the waves move.
What did you set your tiling amount to? As I mention in the tutorial, since we're using object UV's you need to use round numbers only because you can't tile an image by a half, or a ".3" you know? If you want more control over the scale, then go with world space UV's (my previous ocean shadergraph tutorial covers worldspace UV's)
@@PolyToots My tiling is set to 100 so it is "roundable"
@@gnazty92 I'm worried that your tiling is set so high, what on earth are you doing!?
@@PolyToots Actually my plane mesh is not the one you use, but a self-made one that is 500x500 meters. Hence the high amount of tiling :)
Ah, if you're planning to tile such a high amount then the texture I provide might be too repetitive as a base.
Oh i'll hoppity skippity alright
Make sure you don't skippity trippity though.
@@PolyToots hahah I'm always trippitying
Awesome tutorial brother. But is there anyone here who can point me in the right direction to understand why you are doing what you are doing coz I don't understand shit. I'm from a programming background and I can't do anything more than following the whole tutorial step by step. 😒
Great share btw.
How to like this video 100 times?
Once is enough, thanks!
Maybe try do Volumetric Clouds in Shader Graph? Pls
This is probably not going to happen, at-least not a conversion of the amplify tutorial I had done. It's a complex node set-up even with amplify, so with shader graph it would be an absolute nightmare. Complete spaghetti.
@@PolyToots I checked out your channel but wasn't able to find the cloud shader you spoke of. Would you be able to link it?
Great ocean tutorial btw
@@sanovictus Ah right, yeah it's not called a "Cloud" one specifically, might be why. It's here: ua-cam.com/video/Ixt8GpfzFS8/v-deo.html. I am currently looking into a potentially better method for volumetric rendering though, I am not 100% happy with the results of that tutorial.
How can you fix the seams when tiling? I'm using the same maps
where can i get the ocean normal and height images?