Here are some tests using a shader to drive the absorption coefficient: (scattering coefficient is zero, so no scattering). There's a cube with IOR 1.0 in the middle of this scene.

Please excuse the noisy renders, I'm working on an old laptop.

Clamped sin wave absorption with phase increasing to the right:

Code: Select all

```
<absorption_coefficient>
<shader>
<shader>
<![CDATA[
def eval(vec3 pos) vec3 :
vec3(
sin(
doti(pos) * 10.0
)
)
]]>
</shader>
<wavelength_dependent>false</wavelength_dependent>
</shader>
```

Code: Select all

```
<absorption_coefficient>
<shader>
<shader>
<![CDATA[
def eval(vec3 pos) vec3 :
vec3(
doti(pos) + 1.0,
0.0, #doti(pos) + 1.0,
1.0 - doti(pos)
)
]]>
</shader>
<wavelength_dependent>true</wavelength_dependent>
</shader>
</absorption_coefficient>
```