foggy water

is it possible in unity? i’m interested in the depth/fog effect, i did search for it but nothing came up…
something like these (from HL2 Lost Coast):



have you tried the ocean project in colaboration thread? http://forum.unity3d.com/threads/16540-Wanted-Ocean-shader

It is possible to do with strumpys shader editor, I think i’ve even seen a post in his thread abt it :wink:

uh…it’s my shader :p, it’s just lack the transition when the camera goes underwater. still can’t find a way to produce it.

I can see the problem with that, but if the water get’s fully foggy before it’s deep enough to dive into you might be able to get away with just changing scene fog distance and color.

rea,

Is there any chance to share that shader/graph? I have been trying to write that one by scratch for some time now(need to make brownish/greenish cast water with fog). Just really trying to get into the Strumpy shader editor and I saw this thread. Thanks for your time.

Sincerely,

Gary Haus

Thanks but i have only basic knowledge in shaders so it would take me eons to understand it… also it seems to me they’re focusing more on waves rather than the effect i’m interested in…
The shader editor seems a very useful tool, i’m going to explore it when i’ll have the time…
So yeah if anyone would share a shader, graph or just a guideline for a simple foggy water it would be very appreciated ^^

452370–15774–$Graph.rar (6.67 KB)
here guys, feel free to use it. Btw is there somebody who can help produce the correct underwater effect with fog/depth illusion it would be great?
Uh btw, sorry if the graph looks messy, it’s still has some false refraction since iam using grabpass for refraction. is there any of you who can fix that please let me know about it.

Yeah, but if we doing that the fog will affect the scene above the water to, while what we need is dense fog under the water scene and normal fog above the water so we can still see the scene above the water from under. <= to be honest i little confused reading my own word XD

uh sorry there still unused node in my prevoust post. use this one, i already cleaned it.
452370–15773–$Graph.rar (6.68 KB)

452370–15774–$Graph.rar (6.67 KB)

thank you, i’ll give it a try :smile:

In underwater vs on the surface of water I would actually have two different shaders / states. I would use a nice reflection shader with ripples and reflection and depth biased fogging for on the surface. Then when you are in the water I would use some form of fog volume or screen space post process to make the water look murky like in those HL2 pics. I am pretty sure they mark their assets up as ‘water volumes’ and the like so when the player is in them it changes the effects that are playing.

A friend of mine calculates fog per pixel, so he just checks whether a pixel is above or below a certain point in world space. I hope that gives you some ideas.