12 Sep, 12 tweets, 5 min read
Now, let me tell you one of the secrets for a fine looking water surface. And it has nothing to do with the water itself! It’s the environment.
From visual aspect, water is a reflection and refraction of surrounding objects, so a good looking sky is where you should start. #b3d
So you want skies like image above? Buy ‘Physical Starlight and Atmosphere’ addon for Blender and support two brothers, entrepreneurs @_karlisup and me. We call ourselves @PhysicalAddons.
blendermarket.com/products/physi…
This is going to be another rant about water rendering.
Not about geometry and not underwater ‘volume’. Just the thin border separating the two worlds.
To understand the water surface shading better I’ll again establish concepts and praxis parts.

Concept 1 - we have to think of air and water as volumes. We observe the border (surface) between the volumes because of the difference of their densities.
Bigger the density difference, more visible is the border.
Just to make my point, here is an image of heat shimmer - basically, air/air border. Hot and cold air has different densities. The difference is so low that we can only notice it if we are really looking for it.
Perhaps the future Blender version will be able to calculate the borders between volumes automatically, and this thread will be obsolete, but till then we have to fake it!
So praxis part - simply imagine the water surface being a plane and approximate the physics with shaders.
First physics approximation and probably my all-time favourite effect - ‘Fresnel effect’.
A proper implementation will give you water look even without reflections.
Here’s an old video of mine of water with fresnel only, rendered in Blender Game Engine.
A ‘proper’ Fresnel effect will have one very important behaviour - the surface does not behave optically same way from both sides!
This is because the refractive index (IOR) changes if the viewer is inside water or air volume.
Left: over water, Right: under water.
Simple math time:

IOR of Air = 1.0
IOR of Water = 1.333

If viewer is in air,
IOR of water surface = Water/Air 1.333/1.0 = 1.333

If viewer is in water,
IOR of water surface = Air/Water
1.0/1.333 = 0.750

So in Blender, upper side of plane will have IOR of 1.333, lower - 0.750
In Blender we disable ‘backface culling’ for our water surface and use ‘backfacing’ vertex attribute to mix between these two values. We then feed it to Refraction shader IOR input field.
Fresnel node in Blender already works this way so no value mixing is necessary.
In GLSL we use reflect(V,N) and refract(V, N, IOR) functions to calculate the texture coordinates, but in Blender, Eevee does all for us thanks to the magic from @hypersomniac_ and the team.
I love peeking up whenever I am under the water to observe the ‘Snell’s window’
To make things more interesting, IOR for water is different for Red, Green and Blue wavelengths.

Red (700 nm) = 1.331
Green (550 nm) = 1.333
Blue (450 nm) = 1.337

This causes slight chromatic aberration for refracted light.

• • •

Missing some Tweet in this thread? You can try to force a refresh

This Thread may be Removed Anytime!

Twitter may remove this content at anytime! Save it as PDF for later use!

# More from @_martinsh

10 Sep
Smooth transition from air to underwater in Blender(work in progress). I’ll do a thread because not often I see it done right in CG.
#b3d
I teach things like these in art college. I guide my students through the analytical process of dissecting the effects of physical lighting and materials.

So there are several concepts you have to understand that will let you create the water transition effect convincing.
First concept - we have to imagine that our Blender camera is actually a real camera. Camera has a sensor, lens assembly and most importantly - a waterproof housing.
(Image source - Outex)