Physically accurate ocean water test

ocean_water

No artistic liberties on water. Water is transparent PBR shader with correct IOR and specular, where I calculated volume for distilled water. Then I added to absorption and scattering for organic matter, and how much there are different kind of particles, and also physically accurate phase function. I can now simply set up water for lakes, coastal regions, ocean, pure water and so on.

it is probably hard to stretch Blender further on accuracy of water material, assuming that I didn’t miss some phenomenom.

7 Likes

is that Blender’s build-in ocean?

PH Bob
Minion World

Could be interesting if you demonstrate it a little bit instead of only one image.

Yeah, there was all phenomenom calculated somewhat realistic usecase and it shows real surface. Scattering and absorption was shown only little in that pole.

So I take same setup, changed sky to synthetic overcast sky with real luminance, added plane below water to 15’ angle having 1mx1m checker with values 0.9 and 0.2, and make water surface perflecty flat. This is very synthetic scenario to reveal what is below surface. First image with waves was oceanic water, so the sky and waves affect a lot how the water looks if compared to synthetic setup.

Distilled water (no particles, just water molecule absorption):

distilled_water

Clear water (minimal amount of particles):

clear_water

Pure sea water (salts and minimal particles):

pure_sea_water

Oceanic waters (salts, minimal particles and some dissolved organic matter and chlorophyll):

oceanic_water

Coastal region water (river delta, brackish water, lots of chlorophyll and organic matter):

coastal_region_water

Lake and river water (full of organic matter, shitty water):

lake_and_river_water

No reference photos were used. Just modelling based on measured values.

1 Like

It is Blender’s build in ocean. And Blender’s ocean is in my opinion really awesome.

Another test image, a bit different camera and sky, still having oceanic water for comparison:

ocean_test

Foam color is calculated based on spectrum, there is a lot of wind causing foam to waves. Amount of foam and foam texture noise is based on reference photos, so there is a bit of artistic liberties.

Ball in image is middlegray, having 10m radius and it breaks ocean surface with constant speed. Foam behind it is somewhat artistic and based on photographs, but waves making wake pattern is accurate as possible what can be done Blender built in simulations.

I actually put all stuff in same nodesetup that only requires to bake ocean and dynamic paint to do elsewhere.

1 Like

Thank u. Really accurate shader.
Bravo

1 Like

How have you managed to handle accurate phase function and stuff?

As far as I know, Blender has just one scattering model. I can’t remember the name, that one with lots of “g”, the same as in OSL.

Or do I miss sonething?

Yes, phase function should be also accurate as possible what is possible with cycles. Backscatter is missing, I don’t know how to do that in cycles.

Major approximation here is that calculation is made in RGB, not in spectral because cycles/eevee doesn’t support that. So I made calculations normalizing curves with green color while human eye is most sensitive to that.

But how you make Blender to use it?
Wrote OSL node with your own scattering?

No, I didn’t wrote OSL. I implemented it with node setup to make it work on GPU, and used Blender scattering model and averaged particle phase function. These limits what is done here, just streching cycles with node setup.

I’m a bit interested on topic how can I do better scattering with cycles. I really like to have both forward scatter and backscatter in same shader but I don’t know how. It is possible that it can be implemented some simple mix shader setup.

That’s the thing I cannot understand. Bender has just one scattering node ‘Volume Scatter’ and it uses built-in phase function henyey_greenstein. So, you just tweaked anisotropy and density parameters?

The function is older than whole computer science. There exist better implementations (at least, for sky). But I have no clue how to use them without hacking deep into Blednder code and making custom build, or submitting a feature patch.

Yes, and with color and absorption. So there is room how to made more accurate but this is cycles with nodes.

with negativ anisotropy setting you get backscatter (-1).With (+1)you get forward scatter.(0)is uniform scattering.

mix or add more scatter nodes with different anisotropy values (for different materials(salt,micro particles ect) inside the water) should work in theory.

I know that I can add and mix shaders but I need to figure out what kind of node combination give phase function close as possible to match with measured phase function.

if you have a measured phase function (a scatter coefficient of the water + particles) then you just need too substract the water absorption coeffiecient from each RGB wavelength.the result is the scatter coeffiecent of the particles then.

“then you just need too substract the water absorption coeffiecient from each RGB wavelength.the result is the scatter coeffiecent of the particles then.”

I’ve done that.

do you mean a custom falloff?afaik the internal math is a linear falloff with distance (Blender unit) and the absorption/scatter color you have put in.
to change this, you can try to multiply your abs/scatter color with ray distance,like gottfried hoffman did with his custom absorption shader.you just have to place "your falloff formula"in between.

This is really cool to see. Would this become significantly simpler and/or more accurate if it was done with spectral rendering?

Thanks! I think this trick could improve shader accuracy to make it better for underwater shots.

Current version has math where absorption is calculated on distance 1m (=one blender unit) but while falloff is linear, this approximation causes error.

What I mean was scattering, that there is “shape” of scattering direction (anisotropic value). And there is both forward scattering and backscattering in water. It currently models only forward scattering.

Current version, underwater shots sucks and I believe spectral rendering could improve those. At least the implemenation could be a lot easier if I can just input real physical values instead of deriving those to RGB values to put in cycles absorption and scattering nodes.

But I try to improve that absorption using that ray distance trick. I think I it may be possible partially implement spectral shader with node setup where I calculate red, green and blue color separately on their wavelenghts based on ray distance.