Mārtiņš Upītis Profile picture
Dad. Co-Founder @physicaladdons. Obsessed with real-time water and atmospherics rendering.

Sep 10, 2021, 15 tweets

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)

In praxis, we can simplify the shape of the housing as a sphere around the centre (sensor) of the Blender camera.

Second concept - There are terms like ‘surface tension’ and ‘cohesion’, but for sake of simplicity, let’s just assume that water is ‘sticky’. It sticks to itself and tends to form a spherical shape. So at its borders, water will bend light like a lens. (Image source Getty Images)

So in Praxis we just don’t let water at it’s edges look flat. How I did it in the video example above? I made a new geometry just for the air/water transition. A thin cylinder slice worked well. Then using ‘shrinkwrap’ modifier, projected it to the water surface.

For ‘rounding the edges’ part, I blended real normals with up vector and ‘virtually’ bent it.

Third and last concept - understanding indices of refraction (IOR) between different mediums. It is probably most complex between the three, but rather important for proper ‘water look’.

Refractive Index between lens and water is different than that of lens and air.

Pro advice: search for real life references. In this case “split level photography” returned stuff I was looking for.
Don’t look for references in games or how others (like me) are ‘faking’ it 😅.

It looks like this in wireframe. The edge ‘fin’ cylinder is vertex parented to the Camera, so it does not rotate with it. The fin has two ‘shrinkwrap’ modifiers influencing upper and lower edges separately. That way I can control the thickness.

Hole in the water surface is shader based, calculated based of distance from Camera object.

Combining the hole and the ‘fin’, it looks like this.

Even though the water surface and edge ‘fin’ are two separate objects, we can make it look like one with normal ‘bending’. I included water surface shader node tree (2nd image) and edge ‘fin’ node tree (3rd).
Note: I disabled transparency for clarity.

I guess I have covered the basics regarding the transition. Seeing that the thread has gained some popularity, I will do the same for other water rendering topics.
Next thread will be about the water surface, where IOR will play significant role.

And to conclude the topic and open the discussion. Have you seen the water surface transition used in any games?
I know @Unigine does it like this (screenshot from water tech video)

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling