OCEAN shader with Unity Shader Graph!

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 519

  • @Designbyapro
    @Designbyapro 5 лет назад +5

    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.

    • @PolyToots
      @PolyToots  5 лет назад

      I guess with this you're trading the edge foam for crystal clear transitions? Sounds like some good tips though, thanks for commenting!

    • @faythe03
      @faythe03 4 года назад +3

      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.

  • @Dedemonn1
    @Dedemonn1 4 года назад +7

    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!

  • @MatheusPratta
    @MatheusPratta 4 года назад +26

    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.

    • @rameezsafdar6563
      @rameezsafdar6563 4 года назад +1

      Thanks man

    • @herpderp728
      @herpderp728 4 года назад +2

      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.

    • @coragem8154
      @coragem8154 2 года назад

      .😁

  • @Miroba16
    @Miroba16 2 года назад +1

    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

  • @romantroshkin3142
    @romantroshkin3142 4 года назад +4

    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.

  • @JMMedinaDev
    @JMMedinaDev 5 лет назад +16

    I like the way your voice is. Its clear, Magic and travel with me in my knowledge journey

    • @PolyToots
      @PolyToots  5 лет назад +3

      Thank you very much!

  • @alkavyrus
    @alkavyrus 4 года назад +2

    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

  • @djkaalo248
    @djkaalo248 3 года назад +3

    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.

  • @K3rhos
    @K3rhos 3 года назад

    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 !

  • @Ineshi93
    @Ineshi93 5 лет назад +19

    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

    • @PolyToots
      @PolyToots  5 лет назад +2

      Ah of course, makes sense that LWRP would have depth disabled. Thanks for discovering it though! I've only recently switched to LWRP myself.

    • @danielvast2007
      @danielvast2007 5 лет назад

      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.

    • @PolyToots
      @PolyToots  5 лет назад +1

      @@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!

    • @kay12755
      @kay12755 5 лет назад

      Mine was still broken with Depth Texture on, but was fixed when I turned both that and Opaque Texture on

    • @Ineshi93
      @Ineshi93 5 лет назад

      @@kay12755 ah my opaque was standard checked, guess both have to be checked then. But glad you found the solution :)

  • @simoneobe4284
    @simoneobe4284 5 лет назад +4

    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.

    • @PolyToots
      @PolyToots  5 лет назад +3

      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.

    • @simoneobe4284
      @simoneobe4284 5 лет назад +1

      @@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.

    • @holliscf
      @holliscf 3 дня назад

      @@simoneobe4284 might be able to put a second object/shader above the surface of the initial voume

  • @Shmojoe14
    @Shmojoe14 5 лет назад +2

    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.

    • @PolyToots
      @PolyToots  5 лет назад +1

      Hah, well thanks for checking it out! You started uploading like a month ago right? Some good numbers for one month, keep it up!

  • @rinsofia8225
    @rinsofia8225 3 года назад +5

    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

  • @MiddleCross378
    @MiddleCross378 4 года назад +2

    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!

    • @PolyToots
      @PolyToots  4 года назад

      Cheers dude, I appreciate the feedback. I'll find a good rhythm eventually!

  • @panickal
    @panickal Год назад

    Nice. Combining this with a tutorial on spherical water to see if I can make good water for planets.

  • @emergencyDuck
    @emergencyDuck 4 года назад +15

    If your water is not moving try turning on "Animated materials" in the scene view

    • @BlueSpawn
      @BlueSpawn 4 года назад +1

      This helped a lot. Thanks!

    • @dungeoy1
      @dungeoy1 2 года назад +2

      If you are having trouble finding "Animated materials", it's now called "Always Refresh".

  • @altugozhan
    @altugozhan 2 года назад

    great tutorial, learned a lot from you and having self conversations with urself in between the tutorial made my day :) Thanks a lot

    • @PolyToots
      @PolyToots  2 года назад +1

      You're very welcome! Thanks for the kind words.

  • @KpopMRlkaraoke
    @KpopMRlkaraoke 4 года назад +4

    i followed one by one but the foam appear to the whole material (plane) instead of surrounding object ( stone )
    using uity 2019.1.8

    • @Miketulli8
      @Miketulli8 4 года назад

      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

    • @DanFMN
      @DanFMN 4 года назад

      Did you ever find a solution to this problem?

    • @louiswu6300
      @louiswu6300 4 года назад

      @@Miketulli8 same problem. But no use whether I switch to transparent or opaque.

  • @zexsoft
    @zexsoft 3 года назад +1

    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?

    • @PolyToots
      @PolyToots  3 года назад +1

      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.

    • @zexsoft
      @zexsoft 3 года назад +1

      @@PolyToots I've found some awesome stuff on the Asset Store since, no worries.

  • @carlosmartinez7468
    @carlosmartinez7468 4 года назад

    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!!

    • @PolyToots
      @PolyToots  4 года назад +1

      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.

  • @JadenAllen
    @JadenAllen 2 года назад

    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?

  • @Simon19903
    @Simon19903 4 года назад +11

    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.

    • @PolyToots
      @PolyToots  4 года назад

      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.

    • @Haunchfluff
      @Haunchfluff 4 года назад

      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.

    • @Snakebloke
      @Snakebloke 3 года назад

      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? :(

    • @Snakebloke
      @Snakebloke 3 года назад

      @Simon
      Sorry, hahaha. Just realised I was being a complete dingus, forgot to "Save Asset" on the shader :grimacing:

  • @alicewithalex
    @alicewithalex 5 лет назад +2

    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
      @PolyToots  5 лет назад +1

      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?

    • @alicewithalex
      @alicewithalex 5 лет назад +1

      @@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

    • @PolyToots
      @PolyToots  5 лет назад

      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.

  • @robertodelgadillo9133
    @robertodelgadillo9133 4 года назад

    This tutorial is insane bro! nice job!

  • @DouglasBurton
    @DouglasBurton 5 лет назад

    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.

    • @Graklynn
      @Graklynn 5 лет назад

      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!

    • @易水-w8s
      @易水-w8s 5 лет назад

      me too......just break the position pin can fixe that,,, but it doesn't look good in that case

  • @alexvandenberg3371
    @alexvandenberg3371 4 года назад +1

    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

  • @sinpros
    @sinpros 4 года назад +4

    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

  • @burakkayalak
    @burakkayalak 3 года назад +4

    [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)

    • @PolyToots
      @PolyToots  3 года назад

      Ah the joys of different unity + shader graph versions. Thanks for the info though Burak, much appreciated.

  • @idnktnomc
    @idnktnomc 3 года назад +1

    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.

    • @Aliberation
      @Aliberation 3 года назад +1

      Man, you saved me a lot of trouble. I wasn't able to make the foam work without this. Thank you very much!

  • @abs22x23
    @abs22x23 4 года назад

    Thank you very much!
    Awesome tutorial, well explained and all. Now my procedural land generator can gerenerate beautiful water too :)

  • @vjanomolee
    @vjanomolee 5 лет назад +1

    Such a great, in-depth(pun intended) tutorial. Thank you. Keep up the good work m8.

    • @vjanomolee
      @vjanomolee 5 лет назад

      Also. I like how you assume that your audience has watched previous tutorials. That makes it more rich.

    • @PolyToots
      @PolyToots  5 лет назад

      Cheers man, always nice to read nice comments!

  • @WolfsdenxD
    @WolfsdenxD 4 года назад +1

    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.

  • @simonlaw4733
    @simonlaw4733 2 года назад +1

    This works in Unity 2020.3.32 where PBR is deprecated. Works with URP not try with other pipeline yet

  • @supremebeme
    @supremebeme 5 лет назад +2

    This is wild bro thank you.

  • @stm91
    @stm91 4 года назад +3

    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.

  • @KDSBestGameDev
    @KDSBestGameDev 4 года назад +2

    I'm still watching. I am at 10:13. The offset is basicly an add operation on the UVs

  • @KDSBestGameDev
    @KDSBestGameDev 4 года назад +2

    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
      @PolyToots  4 года назад +1

      Solid comment! Thank you so much.

    • @KDSBestGameDev
      @KDSBestGameDev 4 года назад

      @@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.

    • @PolyToots
      @PolyToots  4 года назад +1

      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.

  • @yariicke8659
    @yariicke8659 4 года назад +1

    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.

  • @LukeNewcomb
    @LukeNewcomb 5 лет назад

    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?

    • @PolyToots
      @PolyToots  5 лет назад +1

      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.

    • @WJSWebster
      @WJSWebster 5 лет назад +1

      @@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!

  • @MungeParty
    @MungeParty 2 года назад

    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.

    • @PolyToots
      @PolyToots  2 года назад +1

      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.

    • @gigabit6226
      @gigabit6226 Год назад

      "That statement" bro what statement it's a 40 minute long video haha

  • @landvr9466
    @landvr9466 4 года назад +1

    Hey! Any chance you could make a low poly style water shader?

  • @bzouchir
    @bzouchir 5 лет назад +2

    Great tutorial!! would love to know how I can get this to work with LWRP! have you found out why it doesn't? thanks!

    • @PolyToots
      @PolyToots  5 лет назад +2

      It's something to do with the way Unity orders the depth and vertex offsets, sorry man!

  • @anaelhernandezrivera1701
    @anaelhernandezrivera1701 5 лет назад +3

    Hey, I love you tutorial's

  • @weckar
    @weckar 4 года назад

    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...

    • @PolyToots
      @PolyToots  4 года назад +1

      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.

  • @hobolee2073
    @hobolee2073 Год назад

    Thank you so much. Amazing tutorial with perfect explanation on how everything works/

  • @cang34
    @cang34 4 года назад +1

    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).

  • @AnAngryTeacup
    @AnAngryTeacup 5 лет назад +2

    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)

    • @Haunchfluff
      @Haunchfluff 4 года назад

      I am also having the exact same issue with HDRP, did you ever figure out how to resolve this?

  • @TheLonelyDeveloper
    @TheLonelyDeveloper Год назад

    Hello. Do you know if this would work in VR with single pass instanced? A download link would be nice as well :)

  • @adamoosthuizen2409
    @adamoosthuizen2409 5 лет назад +12

    Do you have a picture of your node graph?

  • @Od1UmScourge
    @Od1UmScourge 5 лет назад +2

    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.

    • @PolyToots
      @PolyToots  5 лет назад

      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.

    • @Od1UmScourge
      @Od1UmScourge 5 лет назад

      @@PolyToots Thanks!! UV node helped)

  • @rambii.
    @rambii. 4 года назад +4

    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

    • @NBAntony
      @NBAntony 4 года назад +2

      same problem

    • @rgbeans
      @rgbeans 4 года назад

      you're probably using realtime lighting

    • @rambii.
      @rambii. 4 года назад

      RoboticGaming101 yea I am using real-time lighting for my game

    • @rgbeans
      @rgbeans 4 года назад +1

      @@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.

    • @rambii.
      @rambii. 4 года назад

      RoboticGaming101 that’s what I did instead. Something I somehow figured out on my own while trying different ways of getting foam for work

  • @ridlr9299
    @ridlr9299 4 года назад

    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?

  • @nextcent
    @nextcent 4 года назад

    Amazing tutorial! Thank you for sharing it.

  • @nickgennady
    @nickgennady 5 лет назад

    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

    • @PolyToots
      @PolyToots  5 лет назад

      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.

  • @protossscud8435
    @protossscud8435 4 года назад +1

    Will this method work in HDRP ?

  • @timurtsoy7601
    @timurtsoy7601 4 года назад

    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

    • @PolyToots
      @PolyToots  4 года назад

      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)

  • @awaawa2022
    @awaawa2022 5 лет назад +1

    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.

    • @PolyToots
      @PolyToots  5 лет назад +1

      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"

  • @parkerbobby808
    @parkerbobby808 5 лет назад +2

    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. :)

    • @PolyToots
      @PolyToots  5 лет назад +1

      Cheers man, some good information for me to digest there.

  • @dwassortedmedia
    @dwassortedmedia 4 года назад +2

    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 :/

    • @Novia5555
      @Novia5555 4 года назад

      so it is a bug? I thought I've done it wrong so I check the shader many times.

    • @lacusclyne1689
      @lacusclyne1689 2 месяца назад

      Hi! i have the same problem. Have you fix this one?

  • @francescogagliardi9383
    @francescogagliardi9383 5 лет назад +1

    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!

  • @MatrakenKEN
    @MatrakenKEN 4 года назад

    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.

  • @mashrien
    @mashrien 4 года назад +3

    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.

    • @PolyToots
      @PolyToots  4 года назад +7

      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.

  • @martingrof1685
    @martingrof1685 5 лет назад

    Thank you. Would this be expensive on a mobile device?

    • @PolyToots
      @PolyToots  5 лет назад

      I would say so yeah, you'd probably want to drop the depth completely for mobile. But, no harm in trying right?

  • @mazis23
    @mazis23 4 года назад

    Excellent Tutorial! Bravo !

  • @gilleswalther5964
    @gilleswalther5964 4 года назад

    Awesome tutorial! Thanks

  • @thatprogrammerjack747
    @thatprogrammerjack747 2 года назад

    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?

  • @ReinkeDK
    @ReinkeDK 5 лет назад

    Excellent work!

  • @iixinit6907
    @iixinit6907 5 лет назад

    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?

    • @PolyToots
      @PolyToots  5 лет назад

      That's pretty weird, is it just pink in the game view even if you're not in play mode?

  • @syk9552
    @syk9552 3 года назад

    hi. I followed your video. But, Why my example is not showing foam.

  • @BestAnimations
    @BestAnimations 4 года назад

    Where did you get the 2D texture? You never even dragged it into yours node.

    • @PolyToots
      @PolyToots  4 года назад

      Hi, what time in the video are you referring to?

    • @BestAnimations
      @BestAnimations 4 года назад

      @@PolyToots
      There is no time that you reveal where you got the texture. Around 3:50 is where you reveal you have a texture.

    • @PolyToots
      @PolyToots  4 года назад

      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.

    • @BestAnimations
      @BestAnimations 4 года назад

      @@PolyToots
      That did not answer my original question. But I found another tutorial that did.

    • @PolyToots
      @PolyToots  4 года назад

      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.

  • @UrbanArT69
    @UrbanArT69 4 года назад

    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

    • @PolyToots
      @PolyToots  4 года назад +1

      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.

  • @antoinedevldn
    @antoinedevldn 4 года назад

    Masterpiece

  • @MrBdlaaa
    @MrBdlaaa 5 лет назад

    Great tutorial

  • @오늘의괴짜들
    @오늘의괴짜들 5 лет назад

    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 :(

    • @PolyToots
      @PolyToots  5 лет назад

      Hi, that sounds pretty strange. Are you using a value between 0 and 1 for your transparency, or anything else?

  • @HuNzLee
    @HuNzLee 3 года назад

    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?

  • @paulbraddick2085
    @paulbraddick2085 Год назад

    Superb, thank you so much.

  • @hhhhhhhhhhhh7165
    @hhhhhhhhhhhh7165 4 года назад +5

    For those wondering why the emmision doesn't work on HDRP:
    Set the water to static

    • @rambii.
      @rambii. 4 года назад

      Audrey B May I ask where is the option to set it to static?

    • @hhhhhhhhhhhh7165
      @hhhhhhhhhhhh7165 4 года назад

      @@rambii. there's a tickbox in the top right of the inspector

    • @4ghzgaming664
      @4ghzgaming664 4 года назад

      @@hhhhhhhhhhhh7165 That didnt fix it for me

    • @Simon19903
      @Simon19903 4 года назад +1

      @@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.

    • @viktorstanik
      @viktorstanik 3 года назад

      @@Simon19903 It didn´t worked for me, do you have any advice ? :D

  • @nalamthembu6505
    @nalamthembu6505 5 лет назад +1

    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

    • @PolyToots
      @PolyToots  5 лет назад +1

      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!

  • @olij167
    @olij167 2 года назад

    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

  • @newmagicstudio4926
    @newmagicstudio4926 2 года назад

    Can this be used for underwater wave effects for VR?

  • @griffithe2438
    @griffithe2438 3 года назад

    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..

  • @green_lightning17
    @green_lightning17 2 года назад

    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?

    • @raveir
      @raveir 2 года назад

      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.

  • @oskarzygmunt5135
    @oskarzygmunt5135 4 года назад +1

    I am unable to find the foam texture... could you supply a link to it? Thanks!

    • @PolyToots
      @PolyToots  4 года назад +1

      I think it was this one: imgur.com/MSfgtyg but honestly it's pretty terrible.

    • @oskarzygmunt5135
      @oskarzygmunt5135 4 года назад +1

      @@PolyToots Thanks!

  • @CAyou
    @CAyou 5 лет назад +1

    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
      @PolyToots  5 лет назад +3

      Cheers, I'll give it a whirl.

  • @PierreGombaudArt
    @PierreGombaudArt 5 лет назад

    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?

    • @PolyToots
      @PolyToots  5 лет назад

      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.

    • @PierreGombaudArt
      @PierreGombaudArt 5 лет назад

      @@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

  • @weckar
    @weckar 4 года назад

    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...

    • @PolyToots
      @PolyToots  4 года назад

      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.

    • @weckar
      @weckar 4 года назад +1

      @@PolyToots Thanks. I will look into that soon.

    • @weckar
      @weckar 4 года назад

      @@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.

  • @mhdnaderlabbad5887
    @mhdnaderlabbad5887 5 лет назад +2

    Thank you but i have 1 proplem 30:21 this not working foam fot working i cant see foam

    • @luminaryphi4431
      @luminaryphi4431 5 лет назад

      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.

    • @embergamedev
      @embergamedev 5 лет назад

      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.

  • @BlueSpawn
    @BlueSpawn 4 года назад +1

    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!

  • @micmalawi
    @micmalawi 3 года назад

    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.

  • @sanchitgngplays
    @sanchitgngplays 4 года назад

    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.

    • @sanchitgngplays
      @sanchitgngplays 4 года назад

      the foam is like above the surface and not around the object, anything?

  • @PrincessSleepyTV
    @PrincessSleepyTV 4 года назад +1

    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.

    • @PolyToots
      @PolyToots  4 года назад +1

      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.

    • @PrincessSleepyTV
      @PrincessSleepyTV 4 года назад

      @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.

    • @Simon19903
      @Simon19903 4 года назад +1

      @@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😊

  • @Katniss218
    @Katniss218 5 лет назад +2

    Fog of War shader / renderer with the ability to have arbitrary number of arbitrary-sized (view radius) view points (tower/unit/etc positions)?

    • @PolyToots
      @PolyToots  5 лет назад

      Sounds codey to be honest, but I'll keep it in mind!

    • @OfficialNukeDukem
      @OfficialNukeDukem 5 лет назад

      @@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"

  • @storm5009
    @storm5009 5 лет назад

    Beautiful

  • @omarhamdy9782
    @omarhamdy9782 5 лет назад +1

    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.

    • @PolyToots
      @PolyToots  5 лет назад

      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

  • @El_Matador724
    @El_Matador724 3 года назад

    LOVE UNITYYYYYYYYYYYYYYYY!!!!!!!!!!!!

  • @DanIel-fl1vc
    @DanIel-fl1vc 5 лет назад +1

    Is there a way to have objects reflect in the water?

    • @PolyToots
      @PolyToots  5 лет назад

      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.

  • @jeffreyhawkins8714
    @jeffreyhawkins8714 5 лет назад

    Great tutorial. Having an issue with only seeing one layer of the water moving. It's not showing transparency. Any help with that?

    • @PolyToots
      @PolyToots  5 лет назад

      Hey Jeffrey, so you can see both layers, but only one moves, or you can only see one?

    • @jeffreyhawkins8714
      @jeffreyhawkins8714 5 лет назад

      @@PolyToots Only see one

    • @PolyToots
      @PolyToots  5 лет назад

      @@jeffreyhawkins8714 Could you share your shader so I can take a peek?

  • @punchspelledbackwards
    @punchspelledbackwards 3 года назад

    What are the settings on your normal map?