Absorption and scatteringBorgleader wrote:@fused: ok so you used shaders for your waves but apart from that what does the rest of your scene & materials look like? I mean...how did you get the water to not be crystal clear and how did you light it all?

Lighting is sunsky only! Its a very, very simple scene.
I would upload the material, but there currently is a bug in the material editor that screws up the absorption

Anyway: heres the full ocean water material:
Code: Select all
<medium>
<name>MedSea Water_mid3</name>
<precedence>10</precedence>
<basic>
<ior>1.330000</ior>
<cauchy_b_coeff>0.000000</cauchy_b_coeff>
<absorption_coefficient_spectrum>
<rgb>
<rgb>0.004980 0.003765 0.005882</rgb>
<gamma>1.000000</gamma>
</rgb>
</absorption_coefficient_spectrum>
<subsurface_scattering>
<scattering_coefficient_spectrum>
<uniform>
<value>0.004000</value>
</uniform>
</scattering_coefficient_spectrum>
<phase_function>
<uniform />
</phase_function>
</subsurface_scattering>
</basic>
</medium>
<material>
<name>Sea Water_mid3</name>
<specular>
<internal_medium_name>MedSea Water_mid3</internal_medium_name>
<transparent>true</transparent>
<displacement>
<shader>
<shader>
<![CDATA[def Vec3ToReal(vec3 v) real : ((doti(v) + dotj(v) + dotk(v)) / 3.0)
def noise01(vec3 v) real : ((noise(v) + 1.0) * 0.5)
def noise01(vec2 v) real : ((noise(v) + 1.0) * 0.5)
def noise01(real r) real : ((noise(r) + 1.0) * 0.5)
def fbm01(vec3 v, int oc) real : ((fbm(v,oc) + 1.0) * 0.5)
def fbm01(vec2 v, int oc) real : ((fbm(v,oc) + 1.0) * 0.5)
def fbm01(real r, int oc) real : ((fbm(r,oc) + 1.0) * 0.5)
def mulCompVec2(vec2 a, vec2 b) vec2 : vec2(doti(a) * doti(b), dotj(a) * dotj(b))
def mulCompVec3(vec3 a, vec3 b) vec3 : vec3(doti(a) * doti(b), dotj(a) * dotj(b), dotk(a) * dotk(b))
def eval() real: ((fbm(mulCompVec2(getTexCoords(0) * 10.0, vec2(1.00000, 1.00000)),8) * 10.00000) + (fbm(mulCompVec2(getTexCoords(0) * 10.0, vec2(4.00000, 4.00000)),8) * 1.00000)) * 1.00000]]>
</shader>
</shader>
</displacement>
</specular>
</material>