// Bump map with Parallax offset vertex
vertex_program Faron/OffsetMappingVP cg 
{ 
  source FaronOffsetMapping.cg 
  entry_point main_vp 
  profiles vs_1_1 arbvp1 
}

fragment_program Faron/OffsetMappingFP cg
{ 
  source FaronOffsetMapping.cg
  entry_point main_fp
  profiles ps_2_0 arbfp1
} 




material Faron/OffsetMapping/Specular 
{ 

// This is the preferred technique which uses both vertex and 
// fragment programs, supports coloured lights 
   technique 
   {

      // do the lighting and bump mapping with parallax pass 
      pass bump
      {
//	      illumination_stage per_light
	      scene_blend one zero
		    depth_write off
       

        // Vertex program reference 
        vertex_program_ref Faron/OffsetMappingVP 
        { 
// tex scale
          param_named uvScale float4 1 1 0 0

// autos
          param_named_auto lightPosition light_position_object_space 0 
          param_named_auto eyePosition camera_position_object_space 
          param_named_auto worldViewProj worldviewproj_matrix 
        } 



        // Fragment program 
        fragment_program_ref Faron/OffsetMappingFP
        { 
// renderParams: renderDiffuseGrey(-1 or 0..1) renderNormal(0 or 1) renderDisplacement(-1 or 0..1) renderSpecular(-1 or 0..1)
          param_named renderParams float4 -1 1 -1 -1

// Parallax Height scale and bias: height is mult by scale and bias is added; 3rd is for specularPower 0.04 -0.02 32 -1
          param_named scaleBias float4 0.01 -0.04 32 -1

// autos
          param_named_auto lightAmbient ambient_light_colour
          param_named_auto lightDiffuse light_diffuse_colour 0
          param_named_auto lightSpecular light_specular_colour 0
        } 
        



         // Base diffuse texture map
         texture_unit
         { 
//            texture x
//            tex_coord_set 0
         } 

         // Normal map 
         texture_unit
         { 
//            texture x
//            tex_coord_set 1
         } 

         // Height(alpha) map 
         texture_unit
         { 
//            texture x
//            tex_coord_set 2
         } 

         // Specular map 
         texture_unit
         { 
//            texture x
//            tex_coord_set 3
         } 

      } 
   } 


  


// Simple no-shader fallback
   technique 
   { 
      pass 
      { 
         // Base diffuse texture map 
         texture_unit 
         { 
//            texture x
         } 
  	  }
   }


}




material Faron/CurtainFill
{
  technique
  {
    pass
    {
      texture_unit
      {
        texture curtainfill32x32.png
        scale 0.05 0.05
      }
    }
  }
}