Water-like Light Absorption Test

Hello Blenderheads

Currently I tried to set up a shader absorbing light like water does. In detail - long wavelenght gets absorbed rather than shorter wavelenght of course depending on how far the light ray is going thru the water.

I raughly achieved this by modifying a absorption shader group Gottfried Hofmann once put online.

I even tried to adapt this in principle to a Volume Absorption shader but failed. Somehow it seems like the Light Path nodes (by now) does’nt work with Volume Shaders.

Did anyone of you allready managed to achieve this ? Or anyone an idea how to achieve it ?



I don’t know why you wouldn’t just use the volumetric absorption shader, it’s more or less the same thing that’s faked through the raylength node setup.

Hello Ace Dragon

That’s what I’m asking for. I also tried to plug this color ramp thing into a Volumetric Absorption shader to fake a wavelenght absorption in addition to the ordinary volumetric absorption effect but it doesn’t work.

I grabbed the entire group content as seen above and plugged it into the color input of an Volumetric Absorption Shader but the additional color ramp does’nt show any effect then.
I tried to combine the Light Path and Geometry Nodes in any order I can imagine of and probeably making sence to me but it seemly does’nt work in combination with a Volumetric Shader.
But probeably I just did it the wrong way, I just don’t know.

Would be nice if someone could help.

You don’t need to use that node group though (I think that is what Ace is getting at). Just use the volume absorption and set the colour/density values as appropriate. The volume shader itself will take care of the ray length side of things.

Hello moony

Thanks for that comment.
Yes I know this. Just an Volume Absorbtion shader do well in most cases.
I just tried to get some additional effekt, since water isnt absorbing light as straight as the Cycles Volumetric Absorption Shader does by now.
Probeably you both missunderstood what I try to do. Probeably because the color ramp I used above just shows some mainly blueish gradient just as the absorption shader does by itself (as it’s color is set to blue).
And thats another point with this Absorption project depending on wavelenght ( I mean the technical wavelenght of light aka color value in cycles) and the ray lenght. Compared to the existing absorption in cycles the differences would be marginal in most cases.

However, I discovered by now that in fact the Volume Absorption Shader doesnt work with several other nodes (e.g. the Light Path nodes) and I guess thats why my setup doesnt work as I expected.
I did this test just because I like fiddling around with Cycles nodes but since I can’t do any more than fiddling around with them nodes, this “material project” is temporarily closed now. :wink:

Cycles being an RGB renderer, cannot calculate wavelength data but only convert it to RGB (wavelength node), except for the MLT patch which is HIGHLY experimental. Also although volumetrics are here, there needs still work to be done to get it working with with other nodes.

I understand what you want, you want NON-LINEAR wavelength profiling with SELECTIVE spectral control.
So the deeper the ray goes, different wavelengths go at DIFFERENT depths affected (your color ramp).

So for now, for realistic non-linear wavelength absorption, you would need to use a spectral renderer like Luxrender, till Cycles will get such features. Also keep in mind that MLT & Co is needed for such an achievment, especially if you want to absorb on only SPECIFIC wavelengths or even beyond of the optical laws into Infrared & UV, which true water also considers.

The final question: is it scientific or artistic. For the latter it is too slow and IMHO not relevant.

You could use my Wavelength Environment node to emit RGB “wavelengths” and use your node setup to use the raylenght absorption.

The setup would be: Image>WavelengthEnvNode>Object>Yournodesetup /w ramp
You can adjust SELECTIVELY the emitted wavelengths so that you can then correctly map the absorption in RGB.
You can even use the node for the Material to fetch the Wavelenght selectively, so you don’t have to use it as an environment. Depends on what you want to do.

Get it here: http://www.blendswap.com/blends/view/71195