Unity Water Shader Part 1 - Reflection, Refraction and Depth

Поділитися
Вставка
  • Опубліковано 7 сер 2024
  • Part 2 : • Unity Water Shader Par...
    Part 3 : • Unity Water Shader Par...
    Unity Version :
    2020.3.26f1
    Link :
    kMirrors : github.com/Kink3d/kMirrors
    Normal Map : www.filterforge.com/filters/7...
    Music :
    Acoustic Guitar Background Music Guitar Background Music
    Way Home_ by @Tokyo Music Walker
    Cozy Place
    0:00 Normal Map
    5:20 Refraction
    6:31 Reflection
    9:16 Depth
    10:55 Alpha
    11:33 Result
  • Ігри

КОМЕНТАРІ • 71

  • @godtierslayer3046
    @godtierslayer3046 10 місяців тому +1

    The best youtube video I've ever seen on water, I've watch videos on youtube on water in unity for 10 years. This is by far one of the best ones I've ever seen. 🥰😍💖

  • @sharat.achary
    @sharat.achary Рік тому +2

    Learned a lot from this. Thank you very much. This is truly gem.

  • @irrwahn35
    @irrwahn35 10 місяців тому +2

    A 1000 thanks for making this. I hate these stupid voice over tutorials and I’m so glad you explain so much in no time at all without giving me a hard time listening! You’re a great teacher. All the other URP water tutorials are a waste of time compared to yours! Love it a lot and hope you will share more of your awesome work in the future! 🥰

  • @dombibence
    @dombibence Рік тому +1

    Quality video of quality content! Congratulations! Please do more like this! :)

  • @munyunu
    @munyunu Рік тому +1

    Your videos helped me greatly thank you!!

  • @fcoutobh
    @fcoutobh Рік тому +3

    what kind of black magic happened here... congratulations

  • @ahmetomercicek5848
    @ahmetomercicek5848 Рік тому +2

    Thank you so much . Please keep go on .

  • @Random_Guy420
    @Random_Guy420 Рік тому +1

    Damm Thanks Man! very helpful video my brother

  • @chienbanane3168
    @chienbanane3168 Рік тому +1

    This is great!

  • @lychee9216
    @lychee9216 Рік тому +1

    Thank you for the tutorial! Its really good^^

    • @paro456
      @paro456  Рік тому

      You're welcome! :p

  • @sharat.achary
    @sharat.achary 4 місяці тому +1

    For some reason if your water appears opaque in the scene in latest LTS versions, please make sure to enable Opaque Texture along with Depth Texture in the URP settings.

  • @dencesar8602
    @dencesar8602 Рік тому +1

    Top! Many thanks!

  • @dulaldey3669
    @dulaldey3669 Рік тому +1

    thank you so much

  • @nityafumbleswithdesign
    @nityafumbleswithdesign 5 місяців тому +1

    can you please share environment setup and tutorial

  • @ThanhNguyen-po7zy
    @ThanhNguyen-po7zy Рік тому

    Thanks for sharing this tutorial. I have learned a lot from this. I managed to make a big lake from this. I am having a difficulty when another distortion shader (from refraction effect) rendered on the top the the lake. Both use the screen color note but the does not merge together. DO you have any hint to overcome this? Assuming that I only have basic knowledge about the shader graph, but not the shader "script".

    • @paro456
      @paro456  Рік тому

      sorry, I'm not quite sure I understand the issue you're describing. Maybe you could provide a video to help me better understand the situation?

  • @artemis8368
    @artemis8368 Рік тому

    Thank you for this. Its very pretty and useful. Overall everything works fine except the reflections part, where the reflections dont exactly match with the objects, even though i followed all the steps. I ll try to work around it.

    • @paro456
      @paro456  Рік тому

      I suggest resetting the position of the reflection object and adjusting its rotation. This may help resolve this issue.

    • @Random_Guy420
      @Random_Guy420 Рік тому

      Also adjust the Reflection Position too as that helped me

    • @victor.novorski
      @victor.novorski Рік тому

      You need to have the Reflection Game Object to be above the things you want to reflect.

  • @TylerGlenn-ud4ei
    @TylerGlenn-ud4ei Рік тому

    now the water is dark

  • @user-ug6hh4qg3n
    @user-ug6hh4qg3n Рік тому +2

    Hi, the reflection was working for mine until I accidentally added cinemachine to the camera of the reflection gameobject. I removed the chinemachine but realised it messed up the orientation and so tried to fix it by redoing the steps.
    However the problem i have now, after re-following steps, is that the reflection only shows up in parts of the water plane that is underneath terrain gameobject. Meaning that there is no reflection in the exposed parts of the water where it is meant to reflect, only showing reflection when it is inside the terrain mesh (I clip the camera through the terrain).
    Edit: It turns out its not just the reflection, but all the other stuff like the albedo, depth, refraction etc only shows up when camera is between the terrain and water plane
    Edit 2: When I double click on the reflection Game Object and then zoom into the water, the effects start to work again! However zooming in starts to slow dramatically to the point where i cant scroll to zoom in anymore or drag the screen. Only able to move with the WASD Keys via fly mode. It seems to only work in the view port as when I press the play and move around using my characters camera, the effects don't show up.
    Edit 3: When I "hide" the terrain itself (unticking the box), the water reflection - Everything works as intended. Unhiding brings back the problem..

    • @sliceofanime8614
      @sliceofanime8614 10 місяців тому +1

      Having similar issue, have you found any solutions ?

    • @sliceofanime8614
      @sliceofanime8614 10 місяців тому +1

      Never Mind, Reflection Map Reference was wrong in my case.

    • @sliceofanime8614
      @sliceofanime8614 10 місяців тому +1

      Try This ( if still having that issues ) : Screen Depth sampling set to Eye, and Screen Position Mode to Raw in both Depth Group and Depth Fade Group.

  • @rodrigoviotti6175
    @rodrigoviotti6175 Рік тому

    Hey, great content. After watching all 3 parts I'm trying to follow the steps but i can't get it right.
    I'm atatching the material to a plane but it doesn't get transparent, it continues gray after using the scene color with the screen position. I've tried to use only one solid color it worked, but with the screen position ir gets only gray. My shader is alreasy set as trasnparent. Any idea of what i might do?

    • @paro456
      @paro456  Рік тому +1

      Are the Opaque and Depth texture options checked? You can find these two options at 5:46 in the video.

    • @rodrigoviotti6175
      @rodrigoviotti6175 Рік тому

      @@paro456 Got stuck with that 1 second before the you show in the video. tks for the reply!

  • @planebreach
    @planebreach Рік тому

    Have you tried in a closed space scene ? Because when i tried the shader in a tunnel i get the skybox reflection .... the walls and the roof are not taken into account at all.

    • @paro456
      @paro456  Рік тому

      I believe it should function properly in indoor settings. However, if it doesn't, you may want to consider using a reflection probe.

    • @thatguydonut6566
      @thatguydonut6566 Рік тому

      You should look up how reflections work on unity, since if you don't set it up, it will always only reflect the skybox.

  • @grizzlydonnutt
    @grizzlydonnutt Рік тому

    When i go to add the normal map to the meterial theres no were to put it anyone else have the same problem?

    • @thedohmas
      @thedohmas Рік тому

      Remember to save asset when you´re editing the shader. Had the same issue

  • @nadiamarzuki4922
    @nadiamarzuki4922 4 місяці тому

    It looks so good in Unity Editor. Trying to build for Quest 2 but have no idea why the reflection part follows the camera, so when i turn left the reflection moves left too! like its stuck to the camera

    • @paro456
      @paro456  4 місяці тому

      In VR device, screen position seems to be an issue. You can search online for similar queries or wait until I have access to a VR setup to test it.

    • @Pachink0P
      @Pachink0P 29 днів тому

      @@paro456 For me it moves even in Editor. why is that? When i move left, the reflection moves too. Im using Orthographic camera btw

  • @talismanskulls2857
    @talismanskulls2857 Рік тому

    Have any examples not using either URP or HDRP?

    • @paro456
      @paro456  Рік тому

      Maybe you can try to use Amplify Shader Editor to make this shader, it has built-in pipeline support.

  • @WalrusesAreTheOne
    @WalrusesAreTheOne 6 місяців тому

    My water looks so shabby and I can't figure out why. Notice even in the beginning, his water has some tint to it? Mine just looks white. I added a tint to my global and a colored directional light as well as a skybox, but still the same boring white water.

    • @paro456
      @paro456  6 місяців тому

      Perhaps when creating the shader, you accidentally selected the Unlit Shader. Around 0:30 in the video, you can change the material option from Unlit to Lit.

  • @wilk2727
    @wilk2727 Рік тому +1

    I have very odd problem. My water is gray. I can control the shallow water tint by changing albedo RGB value but thats it. Whats even more confusing, water object turns blue when its BELOW terrain. When place on the edge, hidden beneath terrain part of water object is blue as it should, and one that isnt covered by anything, turns gray. It looks like "sun" is bleaching all the color out of it? I have no idea whats going on there. Any help?

    • @paro456
      @paro456  Рік тому +1

      Are the Opaque and Depth texture options checked? You can find these two options at 5:46 in the video.

    • @wilk2727
      @wilk2727 Рік тому

      @@paro456 They are checked. I might have found an fix tho. In Lighting settings I've set new lighting settings asset and set Lighting to Auto Generate. That fixed my water being gray. Although this isn't ideal because I feel like its still not lit properly, and my player character isn't lit at all.
      I feel like a video about project/scene light settings would be good idea there 🤔

    • @paro456
      @paro456  Рік тому

      @@wilk2727 You can download the entire project in the description of my latest video, which may help you find out where the problem is.

    • @wilk2727
      @wilk2727 Рік тому

      @@paro456 Oh, youre right. I've seen the video but didnt notice link in the description. I'll definitely check this out, thanks!

  • @keithpatience1233
    @keithpatience1233 2 місяці тому

    no matter how low i put the speed values it still races by really fast

    • @paro456
      @paro456  2 місяці тому

      You might not be connected the node correctly.

  • @BINEHE-eq1dz
    @BINEHE-eq1dz 27 днів тому

    Hi a quick question,can I use that under Unity build in pipeline?

    • @paro456
      @paro456  24 дні тому

      I don't think Unity Built-in supports Shader Graph, but if it does, I think you should give it a try.

  • @mahoromatic02
    @mahoromatic02 Рік тому +1

    does this work with HDRP to? because whenever i try to use it my reflections get blown out.

    • @paro456
      @paro456  Рік тому +2

      kMirrors only supports the URP pipeline. In HDRP, you can use Screen Space Reflections instead.

    • @mahoromatic02
      @mahoromatic02 Рік тому +1

      @帕羅 Paro thank you. I'll give it a try.

  • @TylerGlenn-ud4ei
    @TylerGlenn-ud4ei Рік тому

    the depth fade makes the water dissappear, any ideas on how to fix?

    • @paro456
      @paro456  Рік тому

      Perhaps your water surface is too close to the ground.

  • @alexpurification1260
    @alexpurification1260 Рік тому +3

    Reflection part is not working for me☹️

    • @richardaen4195
      @richardaen4195 Рік тому +1

      me too

    • @alexpurification1260
      @alexpurification1260 Рік тому +1

      @@richardaen4195 It was working. But didn't notice because of skybox. You can change skybox if you actually follow this video. Reflection might be working for you. Do not convert any Texture to normal map.

    • @richardaen4195
      @richardaen4195 Рік тому +1

      @@alexpurification1260 I'm getting closer. I have the skybox reflecting. But not the other game objects in the scene...

    • @alexpurification1260
      @alexpurification1260 Рік тому +1

      @@richardaen4195 check smoothness and alpha

    • @victor.novorski
      @victor.novorski Рік тому +1

      @@richardaen4195 Keep the Reflection Game Object slightly above the object you want to reflect

  • @victor.novorski
    @victor.novorski Рік тому

    Mobile Friendly shader or no?

    • @paro456
      @paro456  Рік тому

      I haven't tried it on mobile platforms myself, but if you want to use it on mobile devices, using planar reflections may consume a lot of performance. Therefore, I suggest using reflection probes instead.

  • @LostAngel175
    @LostAngel175 18 днів тому +1

    學到很多 :)
    想說為甚麼我的水那麼髒,結果只是沒 Depth Texture

    • @paro456
      @paro456  17 днів тому +1

      @@LostAngel175 難得有中文留言🤣

    • @LostAngel175
      @LostAngel175 17 днів тому

      @@paro456 我也想當Technical Artist

  • @Thesomeonevr
    @Thesomeonevr Рік тому

    how do i add the player pls

    • @paro456
      @paro456  Рік тому

      What player?

    • @Thesomeonevr
      @Thesomeonevr Рік тому

      @@paro456 The player that you use to get the ripples and how do i set it up can you maybe do a tutorial