Mārtiņš Upītis Profile picture
Sep 12, 2021 12 tweets 5 min read Read on X
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:
blendermarket.com/products/physi…
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!

PDF

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

Feb 9, 2022
exercise - real anisotropic reflections in Eevee render in #blender.

In theory it means that surface has ‘controlled’ scratches going in same general direction.

My first tests turned out quite pretty, although requires multiple render samples unlike the analytic approach. ImageImageImageImage
With Voronoi texture you can make quite convincing scratching. Each cell gives you ‘position’ data that you can shape into a line and rotate via any data value - texture or vector.

Here is a regular voronoi grid, lines are scaled by a photo and rotated by Perlin noise. Image
goal for this experiment is again automotive shader related - I want to achieve realistic microscratching on shiny surfaces.

This is my first test. I am not entirely satisfied, but I am getting there eventually. Image
Read 8 tweets
Jan 14, 2022
Let’s consider the previous thread a ‘teaser’ for this tweet sized introduction into retroreflectivity in CG.

I’ll explain what it is and how to do it yourself in #blender

As before - I will divide it in ‘Theory’ and ‘Praxis’ parts.

So here we go..
🧵
Just a disclaimer. This will be no science class.
In my side job as a Blender teacher in art college, I convert concepts that are difficult to grasp to simpler analogies and I leave out the hardcore stuff (So I don’t scare away my ‘kids’)

That’s a job for universities.
Theory is simple:

Retroreflectors reflect majority of received light directly back to its source.

How does it differ from specular reflection?

Specular reflection directs only a small portion of light that bounces back from the surface normal facing the source. Image
Read 23 tweets
Jan 4, 2022
I'm now hooked on developing physical automotive materials in Eevee #Blender3d

This time - suede (Alcantara) with varying fiber direction and fingerprint-y anodized aluminum.
The suede material is fully procedural (using Blender built-in Noise) It will look even nicer with real Alcantara surface texture. Fiber flow is again a larger noise color texture, converted to a normal map. ImageImageImage
steering wheel 3D model by Gurdeep Panesar
artstation.com/swedgedesign
Read 10 tweets
Dec 23, 2021
Last day before I take my time off work and I spent it tinkering with car headlights again!
This time I am exploring polarised light and thin-film interference on a transparent body in Blender.

Thank you @KarolMiklas for car model! Beautiful work as always 🙏

Follow the 🧵👇 ImageImageImageImage
Polarised light and Thin-film interference are not the same in terms of physics. One is caused by injection moulding of the plastic, other - by a very thin layer of material on the surface of another material.
Both offer similar looks, so I use the same technique to model it. Image
Here are two real-world examples. ‘Colorisation’ on the headlights are caused by polarisation while on windshield - by a defrosting coating. Most people, including me, mixes these, so for an artist like me, a single approach to tackle both problems, is working just fine! 👌 ImageImage
Read 19 tweets
Dec 10, 2021
Physically-based car headlights in Blender. This method is made for Eevee because refraction and reflections in a single material do not interact nicely.
Here is a breakdown of the classic reflector/refractor headlights. If you want to know more, follow the🧵
#b3d
Let's start with the reflector - the shiny chrome part behind the glass.
Modelling it accurately is rather important, especially if you plan to have the headlight turned on. @KarolMiklas has done sublime work on those! Even for a low-poly car, the normals are silky smooth!
And here's why an accurate model with a nice topology is important. I put a 50-watt "bulb" where it should be in reality. Viewed off-axis, the headlight barely is shining, but once I look head-on, the light is very concentrated. Really cool to see it work in Blender so well!
Read 9 tweets
Sep 24, 2021
This little detail goes a long way. Let’s see if you can spot it!
Another water rendering related thread below.
#b3d
‘Contact line’ or ‘meniscus’ as some of you wrote (I just did not know how to call it) is again the same effect I discussed previously about the bent edge of water surface due physics. In this case the border is now touching a half-submerged object not the lens. Image
Quite often in games we see contact ‘foam’ to show when object is touching water. It works best for stylised water, or larger objects in stormy sea, but smaller objects in still water requires something more subtle. ImageImage
Read 8 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

Don't want to be a Premium member but still want to support us?

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

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(