vertex_program ambient_one_texture_vp_glsl glsl
{
  source ambient_one_texture_vp.glsl

  default_params
  {
    param_named_auto ambient ambient_light_colour
  }
}

vertex_program perpixel_vp_glsl glsl
{
  source perpixel_vp.glsl

  default_params
  {
    param_named_auto world_view_mat worldview_matrix
    param_named_auto world_view_proj_mat worldviewproj_matrix
  }
}

fragment_program perpixel_fp_glsl glsl
{
  source perpixel_fp.glsl

  default_params
  {
    param_named_auto derived_light_diffuse_color light_diffuse_colour 0
    param_named_auto derived_light_specular_color derived_light_specular_colour 0
    param_named_auto surface_shininess surface_shininess

    param_named_auto light_position_view_space light_position_view_space 0
    param_named_auto light_direction_view_space light_direction_view_space 0
    param_named_auto light_attenuation light_attenuation 0
    param_named_auto spotlight_params spotlight_params 0
  }
}

abstract material perpixel_template
{
  technique
  {
    pass ambient
    {
      ambient  1 1 1

      vertex_program_ref ambient_one_texture_vp_glsl {}
    }

    pass light
    {
      max_lights 8
      scene_blend add 
      iteration once_per_light 

      diffuse  1 1 1
      specular .1 .1 .1 128
      emissive 0 0 0

      vertex_program_ref perpixel_vp_glsl {}
      fragment_program_ref perpixel_fp_glsl {}
    }

    /*
    pass decal
    {
      lighting off
      scene_blend add //dest_colour one
    }
    */
  }
}
