;;X5M Shader Created by Napier;;
;------------------------------------------

vf_reflect
{
  cast_shadow=1
  vertex_shader
  {
    file=dyn_standard_reflect_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_reflect_f.cg
  }
}

vf_reflect_bump
{
  ; Texture+bumpmap+reflection map
  vertex_shader
  {
    ;file=dyn_standard_reflect_v.cg
    ;file=dyn_standard_bump_speca_v.cg
    file=dyn_standard_bump_reflect_v.cg
  }
  fragment_shader
  {
    ;file=dyn_standard_reflect_f.cg
    ;file=dyn_standard_bump_speca_f.cg
    file=dyn_standard_bump_reflect_f.cg
  }
}

vf_bump_speca
{
  ; Specular control using the diffuse's alpha channel
  vertex_shader
  {
    file=dyn_standard_bump_speca_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_bump_speca_f.cg
  }
}

vf_glass
{
  vertex_shader
  {
    file=dyn_standard_reflect_window_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_reflect_window_f.cg
  }
}

vf_emission
{
  vertex_shader
  {
    file=dyn_standard_v.cg
  }
  fragment_shader
  {
    file=standard_hlight_f.cg
  }
}

vf_bump
{
  cast_shadow=1
  compression=0
  tangents=1
  ; Texture+bumpmap
  vertex_shader
  {
    file=dyn_standard_bump_v.cg
    ;file=dyn_standard_reflect_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_bump_f.cg
    ;file=dyn_standard_reflect_f.cg
  }
}
vf_reflect_chrome
{
  reflect=2.9
  shininess=40
  diffuse=0.1 0.1 0.1 1
  specular=1 1 1 1
  ambient=0.25 0.25 0.25 1
  mipmap_bias=4
  cast_shadow=1
  vertex_shader
  {
    file=dyn_standard_reflect_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_reflect_f.cg
  }
}
vf_standard
{
  cast_shadow=1
  compression=0
  tangents=1
  vertex_shader
  {
    file=dyn_standard_v.cg
  }
  fragment_shader
  {
    file=standard_f.cg
  }
}

vf_bump_reflect
{
  cast_shadow=1
  compression=0
  tangents=1
  ; Texture+bumpmap
  vertex_shader
  {
    file=dyn_standard_bump_reflect_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_bump_reflect_f.cg
  }
}

;body-----------------------------------------------------------------------------

shader_body~vf_reflect
{
tangents=1
compression=1
reflect=0.2
diffuse=0.75 0.75 0.75 1
ambient=0.6 0.6 0.6 1
shininess=16
specular=0.75 0.75 0.75 1
fresnel
 {
   bias=0.1
   power=3.0
   scale=0.9
 }
layer0
 {
  map=body.tga
 }
layer1
 {
  map=$trackenvmap
 }
layer2
 {
   map=noise.tga
   mipmap_lod_bias=-1 
   }
}

;metalbody--------------------------------------------------------------------

shader_chrome~vf_reflect
{
reflect=1.357
diffuse=1 1 1
ambient=0.57 0.57 0.57
shininess=753
specular=0.357 0.357 0.357
layer0
{
  map=chrome.tga
  
 }
 layer1
  {
   map=$trackenvmap
   }
}

shader_silver~vf_reflect
{
compression=0
reflect=0.06
diffuse=0.75 0.75 0.75
ambient=0.57 0.57 0.57
shininess=15
specular=0.37 0.37 0.37
 layer0
 {
  map=silver.tga
   }
layer1
 {
   map=$trackenvmap
 }
}

;----------------------------------------------

shader_black~vf_standard
{
reflect=0.07
ambient=1 1 1
specular=0.07 0.07 0.07
shininess=24.57
 layer0
 {
  map=black.tga
   }
layer1
 {
   map=$trackenvmap
 }
}

shader_black1~vf_reflect
{
reflect=0.07
ambient=0.937 0.937 0.937
specular=0.137 0.137 0.137
shininess=35.7
 layer0
 {
  map=black1.tga
   }
layer1
 {
   map=$trackenvmap
 }
}

shader_black2~vf_standard
{
reflect=0.07
ambient=1 1 1
specular=0.07 0.07 0.07
shininess=13.57
 layer0
 {
  map=black2.tga
   }
layer1
 {
   map=$trackenvmap
 }
}



shader_under~vf_standard
{
reflect=0.07
ambient=1 1 1
specular=0.07 0.07 0.07
shininess=13.57
 layer0
 {
  map=under.tga
   }
layer1
 {
   map=$trackenvmap
 }
}

shader_frame~vf_standard
{
 layer0
 {
  map=frame.tga
   }
layer1
 {
   map=$trackenvmap
 }
}

shader_X5Mtex~vf_standard
{
reflect=0.357
diffuse=1.37 1.37 1.37
ambient=0.75 0.75 0.75
specular=0.137 0.137 0.137
shininess=37.5
 layer0
 {
  map=X5Mtex.tga
 }
}

shader_plate_JP~vf_reflect_bump
{
  ambient=0.3 0.3 0.3
  diffuse=0.4 0.4 0.4
  specular=1 1 1
  shininess=128
  tangents=1
  reflect=0.2
  cast_shadow=0
  layer0
  {
  	mipmap_lod_bias=-4
    map=plate_JP.tga
  }
  layer1
  {
  	mipmap_lod_bias=-4
    map=plate_JP_n.tga
	mode=linear
  }
  layer2
  {
	map=$trackenvmap
	mode=linear
  }
}

shader_plate_EU~vf_reflect_bump
{
  ambient=0.3 0.3 0.3
  diffuse=0.4 0.4 0.4
  specular=1 1 1
  shininess=128
  tangents=1
  reflect=0.2
  cast_shadow=0
  layer0
  {
  	mipmap_lod_bias=-4
    map=plate_EUga
  }
  layer1
  {
  	mipmap_lod_bias=-4
    map=plate_EU_n.tga
	mode=linear
  }
  layer2
  {
	map=$trackenvmap
	mode=linear
  }
}

shader_interior~vf_bump
{
  compression=0
  reflect=0.357
  ambient=1.537 1.537 1.537
  diffuse=1.37 1.37 1.37
  specular=0.157 0.157 0.157
  shininess=17
  tangents=1
  layer0
  {
    map=interior.tga
  }
  layer1
  {
    mipmap_lod_bias=-2
    map=interior_n.tga
    mode=linear
  }
  layer2
  {
    map=$trackenvmap
    mode=linear
  }
}

shader_interior1~vf_bump
{
  compression=0
  reflect=0.357
  ambient=1.537 1.537 1.537
  diffuse=1.37 1.37 1.37
  specular=0.157 0.157 0.157
  shininess=17
  tangents=1
  layer0
  {
    map=interior1.tga
  }
  layer1
  {
    mipmap_lod_bias=-2
    map=interior1_n.tga
    mode=linear
  }
  layer2
  {
    map=$trackenvmap
    mode=linear
  }
}

shader_wood~vf_reflect
{
compression=0
reflect=0.1
diffuse=0.75 0.75 0.75
ambient=0.57 0.57 0.57
shininess=15.7
specular=0.37 0.37 0.37
 layer0
 {
  map=wood.tga
   }
layer1
 {
   map=$trackenvmap
 }
  layer2
  {
	map=$trackenvmap
	mode=linear
  }
}

shader_lights~vf_reflect_bump
{
  ambient=0.3 0.3 0.3 1
  diffuse=0.6 0.6 0.6 1
  specular=1 1 1 1
  shininess=128
  tangents=1
  reflect=0.2
  cast_shadow=0
  layer0
  {
  	mipmap_lod_bias=-2
    map=lights.tga
  }
  layer1
  {
  	mipmap_lod_bias=-2
    map=lights_n.tga
	mode=linear
  }
  layer2
  {
	map=$trackenvmap
	mode=linear
  }
}

shader_X5Mtex1~vf_reflect
{
compression=0
reflect=0.1
diffuse=0.75 0.75 0.75
ambient=0.57 0.57 0.57
shininess=15.7
specular=0.37 0.37 0.37
 layer0
 {
  map=X5Mtex1.tga
   }
layer1
 {
   map=$trackenvmap
 }
 layer2
 {
 map=noise.tga
 mipmap_lod_bias=-2
 }
}

shader_button~vf_standard
{
reflect=0.237
diffuse=1 1 1
ambient=0.7 0.7 0.7
layer0
{
  map=button.tga
  shininess=20
  blendfunc=blend
  depthwrite=0
 }
 layer1
  {
   map=$trackenvmap
   depthwrite=0
   }
}

shader_bord~vf_standard
{
layer0
{
diffuse=1.0  1.0  1.0
emission=10 10 10
map=bord.tga
}
}

shader_display~vf_standard
{
layer0
{
diffuse=1.0  1.0  1.0
emission=10 10 10
map=display.tga
}
}

shader_gauge~vf_standard
{
layer0
{
diffuse=1.0  1.0  1.0
emission=10 10 10
map=gauge.tga
}
}

shader_needle~vf_standard
{
layer0
{
diffuse=1.0  1.0  1.0
emission=40 40 40 40
map=needle.tga
}
}

;windows--------------------------------------------------------------------------

shader_windows~vf_glass

{
sort_offset=1
reflect=0.57
diffuse=1 1 1
ambient=1 1 1
layer0
{
  map=windows.tga
  shininess=753
  blendfunc=blend
 }
 layer1
  {
   map=$trackenvmap
   }
}

shader_windows2~vf_glass

{
sort_offset=1
reflect=0.57
diffuse=1 1 1
ambient=1 1 1
layer0
{
  map=windows2.tga
  shininess=753
  blendfunc=blend
 }
 layer1
  {
   map=$trackenvmap
   }
}

shader_windows_front~vf_glass
{
sort_offset=1
reflect=0.57
diffuse=1 1 1
ambient=1 1 1
layer0
{
  map=windows_front.tga
  shininess=753
  blendfunc=blend
 }
 layer1
  {
   map=$trackenvmap
   }
}

shader_glass~vf_reflect
{
sort_offset=1
reflect=1.0
diffuse=1.0 1.0 1.0
ambient=1.0 1.0 1.0
shininess=256
;cull=none
depthwrite=0
layer0
{
  map=glass.tga
  blendfunc=blend
  specular=0.0 0.0 0.0 1.0 
  depthwrite=0
}
 map=$trackenvmap
 depthwrite=0
 }
}
shader_glass1~vf_reflect
{
;was using dyn_reflect_window.cg - shader is buggy ATM (Racer 088)
;temporarily using chrome shader - no fresnel
sort_offset=1
;sort offset needed, otherwise glass hides lit headlamp models..
reflect=1.0
diffuse=1.0 1.0 1.0
ambient=1.0 1.0 1.0
;cull=none
layer0
{
  map=glass1.tga
  shininess=32
  blendfunc=blend
  specular=0.0 0.0 0.0 1.0 
  depthwrite=0
 }
 layer1
  {
   map=$trackenvmap
   depthwrite=0
   }
}

shader_lights_glass~vf_glass
{
cast_shadow=0
;was using dyn_reflect_window.cg - shader is buggy ATM (Racer 088)
;temporarily using chrome shader - no fresnel
sort_offset=1
;sort offset needed, otherwise glass hides lit headlamp models..
reflect=1.0
diffuse=1.0 1.0 1.0
ambient=1.0 1.0 1.0
;cull=none
layer0
{
  map=lights_glass.tga
  shininess=16
  blendfunc=blend
  specular=0.0 0.0 0.0 1.0 
  depthwrite=0
 }
 layer1
  {
   map=$trackenvmap
   depthwrite=0
   }
}


;wheel&tire-------------------------------------------------------------------------

shader_tire~vf_bump
{
  compression=0
  ambient=0.2 0.2 0.2
  diffuse=0.5 0.52 0.53
  specular=0.03 0.03 0.032
  shininess=15
  tangents=1
  layer0
  {
    mipmap_lod_bias=-3
    map=tire.tga
  }
  layer1
  {
     mipmap_lod_bias=-3
     map=tire_n.tga
     mode=linear
   }
  layer2
  {
     map=$trackenvmap
     mode=linear
  }
}

shader_brakedisc~vf_reflect_bump
{
  ambient=0.3 0.3 0.3
  diffuse=0.6 0.6 0.6
  specular=1 1 1
  shininess=100
  tangents=1
  reflect=0.2
  cast_shadow=0
  layer0
  {
    mipmap_lod_bias=-3
    map=brakedisc.tga
  }
  layer1
  {
    mipmap_lod_bias=-3
    map=brakedisc_n.tga
    mode=linear
  }
  layer2
  {
    map=$trackenvmap
    mode=linear
  }
  vertex_shader
  {
    file=dyn_standard_v.cg
  }
  fragment_shader
  {
    file=standard_heat_f.cg
  }
}

shader_caliper~vf_reflect_bump
{
  specular=0.5 0.5 0.5
  shininess=48
  reflect=0.03
  cast_shadow=1
  layer0
  {
    map=caliper.tga
  }
}

shader_Badge~vf_standard
{
reflect=0.237
diffuse=1 1 1
ambient=0.7 0.7 0.7
layer0
{
  map=Badge.tga
  shininess=20
  blendfunc=blend
  depthwrite=0
 }
 layer1
  {
   map=$trackenvmap
   depthwrite=0
   }
}


shader_rim~vf_reflect
{
  ambient=0.5 0.5 0.5
  diffuse=0.5 0.5 0.5
  specular=1.5 1.5 1.5
  shininess=25
  tangents=1
  reflect=0.1
  compression=0
  layer0
  {
    map=rim.tga
  }
  layer1
  {
    map=$trackenvmap
	mode=linear
  }
}

;brakes&lights-----------------------------------------------------------------------

shader_brake~vf_emission
{
  sort_offset=1
  layer0
    {
       map=brake.tga
       blendfunc=add
       ;texenv=replace
       emission=160 100 100 300
    }
}

shader_brake1~vf_emission
{
  sort_offset=1
  layer0
    {
       map=brake1.tga
       blendfunc=blend
       ;texenv=replace
       emission=160 100 100 300
    }
}

shader_lights1~vf_emission
{
  sort_offset=1
  layer0
    {
       map=lights1.tga
       blendfunc=add
       ;texenv=replace
       emission=200 200 200 200
    }
}

shader_lights2~vf_emission
{
  sort_offset=1
  layer0
    {
       map=lights2.tga
       blendfunc=add
       ;texenv=replace
       emission=40 40 40
    }
}

shader_lights3~vf_emission
{
  sort_offset=1
  layer0
    {
       map=lights3.tga
       blendfunc=add
       emission=100 100 100 100
    }
}

shader_lights4~vf_emission
{
  sort_offset=1
  layer0
    {
       map=lights4.tga
       blendfunc=add
       emission=200 200 200
    }
}

shader_re~vf_emission
{
  sort_offset=1
  layer0
    {
       map=re.tga
       blendfunc=add
       ;texenv=replace
       emission=100 100 100 100
    }
}

shader_signal~vf_emission
{
  sort_offset=1
  layer0
    {
       map=signal.tga
       blendfunc=add
       diffuse=1.7 1.7 1.7
       emission=270 190 80 200
    }
}

shader_signal1~vf_emission
{
  sort_offset=1
  layer0
    {
       map=signal1.tga
       blendfunc=blend
       diffuse=1.0  1.0  1.0
       emission=27 19 8 10
    }
}

shader_signal2~vf_emission
{
  sort_offset=1
  layer0
    {
       map=signal2.tga
       blendfunc=add
       blendfunc=add
       emission=20 30 30
    }
}

;mirror---------------------------------------------------------------------------------

shader_mirror
{
  layer0
    {
       map=$mirror
       texscale_s=1
       texscale_r=1
       texscale_t=1
       emission=0.3 0.3 0.3 1
    }
}

shader_b_mirror
{
  layer0
    {
       map=$mirror
       texscale_s=1
       texscale_r=1
       texscale_t=-1
       emission=0.3 0.3 0.3 1
    }
}





