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
(This is my attempt for clickbaity advertisement)
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.
more info:…
This is going to be another rant about water rendering.
Topic - water surface shading.
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

Keep Current with Mārtiņš Upītis

Mārtiņš Upītis Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!


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

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

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.
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. Image
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) Image
Read 15 tweets

Did Thread Reader help you today?

Support us! We are indie developers!

This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!