- Home /
Underwater Effect
Hi, I was just experimenting with the advanced water in Unity. I had it so that the water was opaque on both sides, but I wanted it to be transparent. I managed to adjust the fresnel, etc. to make it transparent when looking at it from above, but when you go underneath it and look up at it the water is completely opaque. I've tried adjusting a multitude of properties but I can't get the underside to be transparent. Also, I don't have Unity pro, which is probably the biggest problem, but is there a way to make it work without it? Thanks in advance. Maybe it has to do with the shader? Any ideas? Thanks in advance.
The same thing happens with both the Water4Example(Advanced) and Water4Example(Simple) Prefabs
Duplicate the water, change the copy Y value to be a hair less than the orig, and flip it over, then test again
I would bet it's because it's not the Pro water, but you probably want to get in the shader and change the culling to cull out the underside (it sounds like it's set to CULL OFF, but you'll want to cull CCW (or CW depending on the mesh format)). Generally culling is on, so I'm surprised it's off.
You can make the free water transparent, check my answer here
This answer will get the simple water mesh double-sided.
Another great answer by Aldo for adding underwater fog settings.
Hi, thanks for all the answers, but in relation to supernat's answer, cull was set to off on both subshaders, and it didn't recognize CW or CCW.
Also, thanks for the answer alucardj, but both scripts didn't have any effect. I am fairly certain it is because I don't have unity pro.
Answer by AlucardJay · Mar 28, 2014 at 01:50 AM
from my comment :
You can make the free water transparent, check my answer here
This answer will get the simple water mesh double-sided.
Another great answer by Aldo for adding underwater fog settings.
Edit :
I do not have pro, this works.
1 : Scene with terrain and Daylight Simple Water (2 cameras to show above and below water)
2 : After modifying the FX-Water Simple shader
3 : Don't forget to modify the alpha value
4 : After adding the double-sided mesh script to the water object
Hey thanks for the answer, it really helped! One small problem though: it won't render any trees, grass, or any other gameobjects for that matter on the opposite side of the water! Any ideas?
Thanks for letting me know this method doesn't render anything behind the water. I have modified the answer on my other question to hopefully fix this, basically change the Tags line.
at line 58-59 of the FX-Water Simple shader, after
// -----------------------------------------------------------
// Fragment program
replace :
Subshader {
Tags { "RenderType"="Opaque" }
Pass {
with :
Subshader {
Tags { "Queue"="Transparent" "RenderType" = "Transparent" }
Blend SrcAlpha One$$anonymous$$inusSrcAlpha
Color$$anonymous$$ask RGB
Pass {
tested with trees and grass :
Another reference link I had bookmarked and forgot about :
There's some easier stuff on youtube by speedtutor :
Thank you your answer was perfect! Turns out all I needed was the "Queue" = "Transparent"
statement.
Your answer
Follow this Question
Related Questions
Underwater implementation 1 Answer
How do I make the area under my water (a plane) look like its underwater? 4 Answers
Swimming/Underwater 3 Answers
water3, problem beeing underwater (game stucks) 4 Answers
need water!!! 1 Answer