Material Database

View Source

<?xml version="1.0" encoding="utf-8" ?>
<scenedata>
    <medium>
        <name>bubble_medium</name>
        <precedence>10</precedence>
        <basic>
            <ior>1</ior>
            <cauchy_b_coeff>0</cauchy_b_coeff>
            <absorption_coefficient_spectrum>
                <rgb>
                    <rgb>0.24 0.9 10</rgb>
                    <gamma>1</gamma>
                </rgb>
            </absorption_coefficient_spectrum>
            <subsurface_scattering>
                <scattering_coefficient_spectrum>
                    <uniform>
                        <value>1000</value>
                    </uniform>
                </scattering_coefficient_spectrum>
                <phase_function>
                    <uniform />
                </phase_function>
            </subsurface_scattering>
        </basic>
    </medium>
    <material>
        <name>surface</name>
        <phong>
            <specular_reflectivity>
                <shader>
                    <shader>
                        <![CDATA[def thickness() real:
	4000.0 * (1.0 + 0.25 * noise(getTexCoords(0)*2.0))

def cos_n(real cosi, real n) real:
	sqrt ( 1.0 - (1.0 - cosi*cosi ) / (n*n) )
	

def eval(real wavelen, vec3 pos) real :
	pow ( sin ( 
		(
		    1.0 / cos_n(minCosTheta(),1.50)
		+ 1.0 / cos_n(maxCosTheta(),1.50) ) 
		* ( thickness() / wavelen)
		) , 2.0 )]]>
</shader>
                </shader>
            </specular_reflectivity>
            <exponent>
                <constant>100</constant>
            </exponent>
            <layer>0</layer>
            <fresnel_scale>1</fresnel_scale>
            <ior>2</ior>
            <nk_data />
        </phong>
    </material>
    <material>
        <name>inside</name>
        <specular>
            <internal_medium_name>bubble_medium</internal_medium_name>
            <transparent>true</transparent>
            <layer>0</layer>
        </specular>
    </material>
    <material>
        <name>pearl</name>
        <blend>
            <a_name>surface</a_name>
            <b_name>inside</b_name>
            <blend>
                <constant>0.6</constant>
            </blend>
            <step_blend>false</step_blend>
        </blend>
    </material>
</scenedata>

-->