Material Database

View Source

<?xml version="1.0" encoding="utf-8"?>
<scenedata>
	<medium>
		<name>scratched-glass_medium</name>
		<precedence>10</precedence>
		<basic>
			<ior>1.51</ior>
			<cauchy_b_coeff>0.0042</cauchy_b_coeff>
			<absorption_coefficient_spectrum>
				<regular_tabulated>
					<start_wavelength>3.6e-007</start_wavelength>
					<end_wavelength>8.2e-007</end_wavelength>
					<num_values>93</num_values>
					<values>23.8628 22.2241 20.6 19.0141 17.4457 15.1409 12.8684 10.6497 8.46142 8.27313 8.08509 7.89819 7.71155 7.72822 7.74491 7.76246 7.77999 7.36452 6.9502 6.53786 6.12664 5.79608 5.46626 5.13715 4.80875 4.68761 4.56655 4.46738 4.36828 4.3061 4.24395 4.16005 4.0762 4.10312 4.13002 4.13431 4.13858 4.40176 4.66533 4.9083 5.15164 5.54212 5.93341 6.30462 6.67669 6.9913 7.30643 7.59944 7.89298 8.62798 9.3661 10.0864 10.8099 11.3463 11.8844 12.447 13.0113 13.6732 14.3378 15.005 15.6749 15.9349 16.1953 16.4352 16.6754 17.387 18.1017 18.8195 19.5403 20.63 21.7266 22.8073 23.8951 24.1723 24.45 24.728 25.0066 26.3696 27.7437 29.1068 30.4812 31.0633 31.6474 32.2346 32.8238 33.3592 33.8962 34.4128 34.9311 35.4006 35.8715 36.3436 36.8172 </values>
				</regular_tabulated>
			</absorption_coefficient_spectrum>
		</basic>
	</medium>
	<material>
		<name>scratched-glass</name>
		<specular>
			<internal_medium_name>scratched-glass_medium</internal_medium_name>
			<transparent>true</transparent>
			<bump>
				<shader>
					<shader><![CDATA[def scratchcoords( vec2 pos ) vec2 :
	vec2(  7. * ( doti ( pos  )  + noise(pos*0.1)) , 200. * ( dotj ( pos  ) + noise( pos*0.2) ) )

def rotmat ( real x, real y) mat2x2 :
	mat2x2( x, y, 0. - y, x)


def scratchvec(real x, real y) real :
	min ( 0. , 
		0.5 + fbm (  scratchcoords(rotmat(x,y) * ( getTexCoords(0) + vec2(x,y) )  ), 5 ) )

def eval() real :
	0.00005 * (	scratchvec(1.0,0.0)
			+ scratchvec(0.9,0.3)
			+ scratchvec(-0.707,0.707)			
			+ scratchvec(0.1,0.95)
			+ scratchvec(-0.75,0.6)
			+ scratchvec( -0.5 ,0.8 )
			+ scratchvec( -0.51 ,0.85 )
			+ scratchvec( 0.57 ,0.82 )
			+ scratchvec( -0.43 ,0.90 )
			+ scratchvec( 0.98 , -0.19 )
		     )]]></shader>
				</shader>
			</bump>
			<layer>0</layer>
		</specular>
	</material>

</scenedata>

-->