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 - Ігри
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. 🥰😍💖
Learned a lot from this. Thank you very much. This is truly gem.
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! 🥰
Quality video of quality content! Congratulations! Please do more like this! :)
Thank you!!
Your videos helped me greatly thank you!!
what kind of black magic happened here... congratulations
Thank you so much . Please keep go on .
Damm Thanks Man! very helpful video my brother
This is great!
Thank you for the tutorial! Its really good^^
You're welcome! :p
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.
Top! Many thanks!
thank you so much
can you please share environment setup and tutorial
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".
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?
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.
I suggest resetting the position of the reflection object and adjusting its rotation. This may help resolve this issue.
Also adjust the Reflection Position too as that helped me
You need to have the Reflection Game Object to be above the things you want to reflect.
now the water is dark
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..
Having similar issue, have you found any solutions ?
Never Mind, Reflection Map Reference was wrong in my case.
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.
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?
Are the Opaque and Depth texture options checked? You can find these two options at 5:46 in the video.
@@paro456 Got stuck with that 1 second before the you show in the video. tks for the reply!
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.
I believe it should function properly in indoor settings. However, if it doesn't, you may want to consider using a reflection probe.
You should look up how reflections work on unity, since if you don't set it up, it will always only reflect the skybox.
When i go to add the normal map to the meterial theres no were to put it anyone else have the same problem?
Remember to save asset when you´re editing the shader. Had the same issue
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
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.
@@paro456 For me it moves even in Editor. why is that? When i move left, the reflection moves too. Im using Orthographic camera btw
Have any examples not using either URP or HDRP?
Maybe you can try to use Amplify Shader Editor to make this shader, it has built-in pipeline support.
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.
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.
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?
Are the Opaque and Depth texture options checked? You can find these two options at 5:46 in the video.
@@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 🤔
@@wilk2727 You can download the entire project in the description of my latest video, which may help you find out where the problem is.
@@paro456 Oh, youre right. I've seen the video but didnt notice link in the description. I'll definitely check this out, thanks!
no matter how low i put the speed values it still races by really fast
You might not be connected the node correctly.
Hi a quick question,can I use that under Unity build in pipeline?
I don't think Unity Built-in supports Shader Graph, but if it does, I think you should give it a try.
does this work with HDRP to? because whenever i try to use it my reflections get blown out.
kMirrors only supports the URP pipeline. In HDRP, you can use Screen Space Reflections instead.
@帕羅 Paro thank you. I'll give it a try.
the depth fade makes the water dissappear, any ideas on how to fix?
Perhaps your water surface is too close to the ground.
Reflection part is not working for me☹️
me too
@@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.
@@alexpurification1260 I'm getting closer. I have the skybox reflecting. But not the other game objects in the scene...
@@richardaen4195 check smoothness and alpha
@@richardaen4195 Keep the Reflection Game Object slightly above the object you want to reflect
Mobile Friendly shader or no?
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.
學到很多 :)
想說為甚麼我的水那麼髒,結果只是沒 Depth Texture
@@LostAngel175 難得有中文留言🤣
@@paro456 我也想當Technical Artist
how do i add the player pls
What player?
@@paro456 The player that you use to get the ripples and how do i set it up can you maybe do a tutorial