Material Database

View Source

<?xml version="1.0"?>
<scenedata>
	<material>
		<name>flakes</name>
		<phong>
			<specular_reflectivity>
				<constant>
					<rgb>
						<rgb>0.9 0.9 0.9</rgb>
						<gamma>2.2</gamma>
					</rgb>
				</constant>
			</specular_reflectivity>
			<exponent>
				<constant>100000</constant>
			</exponent>
			<normal_map>
				<shader>
					<shader><![CDATA[def eval(vec3 pos) vec3 :
              let
                scale = 10000.0
                alpha2 = 0.04 # Roughness
                tex = getTexCoords(0) * scale
                u = gridNoise(tex.x + 7.0, tex.y + 124.0, pos.x * 1000, 43.0)
                v = gridNoise(tex.x + 13.0, tex.y + 175.0, pos.y * 1000.0, pos.z * 1000.0)
                phi = u * 2 * pi()
                cos_theta = sqrt(-(v - 1) / ((alpha2 - 1)*v + 1))
                sin_theta = sqrt(1 - cos_theta*cos_theta)
              in
                 vec3(cos(phi) * sin_theta, sin(phi) * sin_theta, cos_theta)
  ]]></shader>
				</shader>
			</normal_map>
			<layer>0</layer>
			<ior>1.5</ior>
			<nk_data />
		</phong>
	</material>
	<material>
		<name>base</name>
		<phong>
			<specular_reflectivity>
				<constant>
					<rgb>
						<rgb>0.9 0.9 0.9</rgb>
						<gamma>2.2</gamma>
					</rgb>
				</constant>
			</specular_reflectivity>
			<exponent>
				<constant>60</constant>
			</exponent>
			<layer>0</layer>
			<ior>1.5</ior>
			<nk_data />
		</phong>
	</material>
	<material>
		<name>Flake coating</name>
		<coating>
			<absorption>
				<constant>
					<rgb>
						<rgb>24 16.885877775239997 8.810070954456</rgb>
						<gamma>2.2</gamma>
					</rgb>
				</constant>
			</absorption>
			<thickness>
				<shader>
					<shader><![CDATA[def eval(vec3 pos) real :

      0.000004

]]></shader>
				</shader>
			</thickness>
			<roughness>
				<constant>0.1</constant>
			</roughness>
			<normal_map>
				<shader>
					<shader><![CDATA[def eval(vec3 pos) vec3 :
              let
                scale = 10000.0
                alpha2 = 0.04 # Roughness
                tex = getTexCoords(0) * scale
                u = gridNoise(tex.x + 7.0, tex.y + 124.0, pos.x * 1000, 43.0)
                v = gridNoise(tex.x + 13.0, tex.y + 175.0, pos.y * 1000.0, pos.z * 1000.0)
                phi = u * 2 * pi()
                cos_theta = sqrt(-(v - 1) / ((alpha2 - 1)*v + 1))
                sin_theta = sqrt(1 - cos_theta*cos_theta)
              in
                 vec3(cos(phi) * sin_theta, sin(phi) * sin_theta, cos_theta)
  ]]></shader>
				</shader>
			</normal_map>
			<layer>0</layer>
			<fresnel_scale>
				<constant>1</constant>
			</fresnel_scale>
			<ior>2</ior>
			<interference>true</interference>
			<substrate_material_name>flakes</substrate_material_name>
		</coating>
	</material>
	<material>
		<name>speckled car paint substrate</name>
		<blend>
			<a_name>base</a_name>
			<b_name>Flake coating</b_name>
			<blend>
				<shader>
					<shader><![CDATA[
  def eval() real :
    let
		  scale = 10000.0
      r = gridNoise(getTexCoords(0) * scale)
    in
      if r > 0.7 then 1.0 else 0.0
						  ]]></shader>
				</shader>
			</blend>
			<step_blend>true</step_blend>
		</blend>
	</material>
	<material>
		<name>pearlescent car paint</name>
		<coating>
			<absorption>
				<constant>
					<rgb>
						<rgb>8.086793316552 8.160036621648 7.746944380872</rgb>
						<gamma>2.2</gamma>
					</rgb>
				</constant>
			</absorption>
			<thickness>
				<shader>
					<shader><![CDATA[def eval(vec3 pos) real :
  let
    scale = 10000.0
    r = gridNoise(getTexCoords(0) * scale)
	in
    if r > 0.7
    then
      r * 0.001  # Flake
    else
      0.002 # Base

]]></shader>
				</shader>
			</thickness>
			<roughness>
				<constant>0.22499999999999998</constant>
			</roughness>
			<layer>0</layer>
			<fresnel_scale>
				<constant>1</constant>
			</fresnel_scale>
			<ior>1.5</ior>
			<interference>false</interference>
			<substrate_material_name>speckled car paint substrate</substrate_material_name>
		</coating>
	</material>
</scenedata>

-->