<?xml version="1.0" encoding="utf-8"?>

<scene>

	<camera>
		<pos>-0.0350 -0.5740 0.0589</pos>
		<up>0 0 1</up>
		<forwards>0 1 0</forwards>
    <!--<pos>0 4 0</pos>
    <up>0 0 1</up>
    <forwards>0 -1 0</forwards>-->
    

		<aperture_radius>0.002</aperture_radius>
		<focus_distance>0.5612</focus_distance>
		<aspect_ratio>1.33</aspect_ratio>
		<sensor_width>0.036</sensor_width>
		<lens_sensor_dist>0.05</lens_sensor_dist>
		<white_balance>E</white_balance>
	</camera>

  <renderer_settings>
    <width>1200</width>
    <height>900</height>
  </renderer_settings>
	
	<tonemapping>
		<!--<reinhard>
			<pre_scale>4.0</pre_scale>
			<post_scale>1.0</post_scale>
			<burn>6.0</burn>
		</reinhard>-->
    <linear>
      <scale>60</scale>
    </linear>
	</tonemapping>


  <mesh>
    <name>lightmesh</name>

    <normal_smoothing>false</normal_smoothing>

    <embedded>
      <expose_uv_set>
        <index>0</index>
        <name>albedo</name>
      </expose_uv_set>

      <vertex pos="-1.5 0 0" normal="0 -1 0" uv0="-0 -0" />
      <vertex pos="-1.5 0 2" normal="0 -1 0" uv0="-0 1" />
      <vertex pos="1.5 0 2" normal="0 -1 0" uv0="1 1" />
      <vertex pos="1.5 0 0" normal="0 -1 0" uv0="1 -0" />

      <triangle_set>
        <material_name>lightmat</material_name>

        <tri>0 2 1</tri>
        <tri>0 3 2</tri>
      </triangle_set>
    </embedded>
  </mesh>



  <material>
    <name>lightmat</name>
    <diffuse>
      <base_emission>
        <constant>
          <rgb>
            <rgb>
              200000 200000 200000
            </rgb>
            <gamma>1</gamma>
          </rgb>
        </constant>
      </base_emission>
    </diffuse>
  </material>

  <!--<model>
    <pos>1 1 0</pos>
    <scale>0.3</scale>
    <mesh_name>lightmesh</mesh_name>


    <emission_scale>
      <material_name>lightmat</material_name>
      <measure>luminance</measure>
      <value>200</value>
    </emission_scale>
  </model>-->

  <model>
    <pos>1 -1 0</pos>
    <scale>0.3</scale>
    <mesh_name>lightmesh</mesh_name>

    <rotation>
      <axis_rotation>
        <axis>0 0 1</axis>
        <angle>-1.5</angle>
      </axis_rotation>
    </rotation>

    <emission_scale>
      <material_name>lightmat</material_name>
      <measure>luminance</measure>
      <value>200</value>
    </emission_scale>
  </model>


  <!--<skylight>
		<sundir>0.5 -0.3 1</sundir>
		<turbidity>2</turbidity>
	</skylight>-->

  <!--<rectanglelight>
    <pos>7.5 0 7.5</pos>
    <width>5</width>
    <height>5</height>
    <spectrum>
      <uniform>
        <value>10000000</value>
      </uniform>
    </spectrum>
  </rectanglelight>-->

  <background_settings>
    <background_material>
      <material>
        <name>background_material</name>

        <diffuse>
          <base_emission>
            <constant>
              <rgb>
                <rgb>1 1 1</rgb>
                <gamma>1</gamma>
              </rgb>
            </constant>
          </base_emission>
        </diffuse>
      </material>
    </background_material>

    <emission_scale>
      <material_name>background_material</material_name>
      <measure>luminance</measure>
      <value>4</value>
    </emission_scale>
  </background_settings>




  <!--Ground Plane-->
	<material>
		<name>white</name>
		<diffuse>
			<colour>0.7 0.7 0.7</colour>
		</diffuse>
	</material>
	
	
	<!--<material>
		<name>Preview</name>
		<diffuse>
			<colour>0.7 0.7 0.7</colour>
		</diffuse>
	</material>
	
	<material>
		<name>nails</name>
		<diffuse>
			<colour>0.7 0.7 0.7</colour>
		</diffuse>
	</material>

	<material>
		<name>skin</name>
		<diffuse>
			<colour>0.7 0.7 0.7</colour>
		</diffuse>
	</material>-->

  <material>
    <name>head_phong</name>
    <!--<name>defaultMat</name>-->


    <phong>

      <exponent>
        <constant>
          100
        </constant>
      </exponent>

      <texture>
        <uv_set>default</uv_set>
        <path>C:\programming\models\infinite_head\Infinite_Scan_Displacements_Ver0.1\Infinite-Level_02_Disp_NoSmoothUV.tif</path>
        <exponent>2.2</exponent>
        <b>0.025</b>
      </texture>

      <texture>
        <uv_set>default</uv_set>
        <path>C:\programming\models\infinite_head\Infinite_Scan_Ver0.1\Images\Map-COL.jpg</path>
        <exponent>2.2</exponent>
      </texture>

      <bump>
        <texture>
          <texture_index>0</texture_index>
        </texture>
      </bump>

      <diffuse_albedo>
        <texture>
          <texture_index>1</texture_index>
        </texture>
      </diffuse_albedo>

    </phong>
  </material>


  <medium>
    <name>head_medium</name>

    <basic>
      <ior>1.333</ior>
      <cauchy_b_coeff>0.0</cauchy_b_coeff>
      
      <absorption_coefficient_spectrum>
        <rgb>
          <!--<rgb>5 15 15</rgb>-->
          <rgb>5 20 20</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>defaultMat</name>-->
    <name>head_diff_trans</name>

    <diffuse_transmitter>

      <internal_medium_name>head_medium</internal_medium_name>
      <albedo>
        <constant>
          <rgb>
            <rgb>1 1 1</rgb>
            <gamma>1</gamma>
          </rgb>
        </constant>
      </albedo>
    </diffuse_transmitter>
  </material>

  <!--<material>
    <name>defaultMat</name>

    <blend>
      <a_name>head_phong</a_name>
      <b_name>head_diff_trans</b_name>
      <step_blend>false</step_blend>

      <blend>
        <constant>0.5</constant>
      </blend>
      
    </blend>
    
  </material>-->



  <material>
    <name>defaultMat</name>

    <glossy_transparent>
      <internal_medium_name>head_medium</internal_medium_name>

      <texture>
        <uv_set>default</uv_set>
        <path>C:\programming\models\infinite_head\Infinite_Scan_Ver0.1\Images\Map-COL.jpg</path>
        <exponent>1.1</exponent>
      </texture>
      
      <texture>
        <uv_set>default</uv_set>
        <path>C:\programming\models\infinite_head\Infinite_Scan_Displacements_Ver0.1\Infinite-Level_02_Disp_NoSmoothUV.tif</path>
        <exponent>2.2</exponent>
        <b>0.006</b>
      </texture>
      
      
      <absorption_layer_transmittance>
        <texture>
          <texture_index>0</texture_index>
        </texture>
      </absorption_layer_transmittance>
      
       <displacement>
        <texture>
          <texture_index>1</texture_index>
        </texture>
      </displacement>
    
      <exponent>
        <constant>
          100
        </constant>
      </exponent>
    </glossy_transparent>

  </material>
  
  
	<material>
		<name>defaultMataa</name>

    <diffuse>

      <random_triangle_colours>false</random_triangle_colours>
      <!--<albedo>
        <constant>
          <uniform>
            <value>0.5</value>
          </uniform>
        </constant>
      </albedo>-->
  
      <texture>
        <uv_set>default</uv_set>
        <path>C:\programming\models\infinite_head\Infinite_Scan_Displacements_Ver0.1\Infinite-Level_02_Disp_NoSmoothUV.tif</path>
        <exponent>2.2</exponent>
        <b>0.006</b>
      </texture>

     
      <texture>
        <uv_set>default</uv_set>
        <path>C:\programming\models\infinite_head\Infinite_Scan_Ver0.1\Images\Map-COL.jpg</path>
        <!--<path>DSC_0026.JPG</path>-->
        <exponent>2.2</exponent>
      </texture>
      
      <!--<bump>
        <texture>
          <texture_index>0</texture_index>
        </texture>
      </bump>-->

      <displacement>
        <texture>
          <texture_index>0</texture_index>
        </texture>
      </displacement>


      <albedo>
        <!--<texture>
          <texture_index>1</texture_index>
        </texture>-->
        <constant>
          <rgb>
            <rgb>0.6 0.6 0.6</rgb>
            <gamma>1</gamma>
          </rgb>
        </constant>
        <!--<shader>
          <shader>
            <![CDATA[
              def width() real : 0.05
              def scale() real : 300.0
              
              def eval(vec3 pos) vec3 :
  
                  if(fract(e0(getTexCoords(0)) * scale()) < 0.1 || fract(e1(getTexCoords(0)) * scale()) < 0.1,
                  vec3(1.0),
                  vec3(0.3)
                  )
                  
                #  if(e0(getTexCoords(0)) > (1.0 - width()),
                #    vec3(1.0, 0.0, 0.0),
                #    if(e0(getTexCoords(0)) < width(),
                #      vec3(0.0, 1.0, 0.0),
                #      vec3(0.05)
                #     )
                #  )
              
                
                #e1(getTexCoords(0))
                
							  #if(
                 # (e0(intrinsicCoords()) < width()) || (e1(intrinsicCoords()) < width()) || (e0(intrinsicCoords()) + e1(intrinsicCoords()) >= (1.0 - width())),
                 # vec3(0.0),
                 # vec3(1.0)
                 # )
            
            ]]>
          </shader>
        </shader>-->
      </albedo>
      
    </diffuse>
	</material>
		
	<mesh>
		<name>test_mesh</name>
		<normal_smoothing>true</normal_smoothing>

    <max_num_subdivisions>4</max_num_subdivisions>
    <subdivision_smoothing>true</subdivision_smoothing>
    <view_dependent_subdivision>false</view_dependent_subdivision>
    <subdivide_pixel_threshold>0</subdivide_pixel_threshold>
    <subdivide_curvature_threshold>0</subdivide_curvature_threshold>
    <wrap_u>false</wrap_u>

    <scale>1</scale>
		<external>
			<path>C:\programming\models\infinite_head\Infinite_Scan_Ver0.1\Infinite-Level_02.OBJ</path>
		</external>
	</mesh>
	
	<model>
		<pos>-0.1 0 0.1</pos>
		<scale>1</scale>
		<rotation>
			<matrix>
				1 0 0 0 0 -1 0 1 0
			</matrix>
		</rotation>
		<mesh_name>test_mesh</mesh_name>
	</model>

  <!--<model>
    <pos>1.3 1 0</pos>
    <scale>1</scale>
    <rotation>
      <matrix>
        -1 0 0 0 0 1 0 1 0
      </matrix>
    </rotation>
    <mesh_name>test_mesh</mesh_name>
  </model>-->




  <mesh>
    <name>rulermesh</name>

    <normal_smoothing>false</normal_smoothing>

    <embedded>
      <expose_uv_set>
        <index>0</index>
        <name>albedo</name>
      </expose_uv_set>

      <vertex pos="0 0 0" normal="0 -1 0" uv0="-0 -0" />
      <vertex pos="0 0 0.22" normal="0 -1 0" uv0="-0 1" />
      <vertex pos="0.01 0 0.22" normal="0 -1 0" uv0="1 1" />
      <vertex pos="0.01 0 0" normal="0 -1 0" uv0="1 -0" />

      <triangle_set>
        <material_name>rulermat</material_name>

        <tri>0 2 1</tri>
        <tri>0 3 2</tri>
      </triangle_set>
    </embedded>
  </mesh>



  <material>
    <name>rulermat</name>
    <diffuse>
      <albedo>
        <constant>
          <rgb>
            <rgb>0 0.6 0</rgb>
            <gamma>1</gamma>
          </rgb>
        </constant>
      </albedo>
    </diffuse>
  </material>

  <!--<model>
    <pos>0.1 0 0</pos>
    <scale>1</scale>
    <mesh_name>rulermesh</mesh_name>
  </model>-->

</scene>	
