;
; Lambo shaders
;

;
; Vertex/fragment shader templates
;
vf_speca
{
  ; Specular control using the diffuse's alpha channel
  vertex_shader
  {
    file=dyn_standard_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_speca_f.cg
  }
}
vf_reflect
{
  ; Just reflection
  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_reflect_window
{
  vertex_shader
  {
    file=dyn_standard_reflect_window_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_reflect_window_f.cg
  }
}
vf_standard
{
  vertex_shader
  {
    file=dyn_standard_v.cg
  }
  fragment_shader
  {
    file=standard_f.cg
  }
}
vf_bump
{
  vertex_shader
  {
    file=dyn_standard_bump_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_bump_f.cg
  }
}

;
; Racer shaders
;
shader_gloss~vf_reflect_bump
{
  compression=0
  reflect=0.3
  specular=1 1 1
  shininess=50
  ; Need tangents passed while rendering
  tangents=1
  layer0
  {
    map=img/lambobody.tga
    ;blend=src_alpha one_minus_src_alpha
  }
  layer1
  {
    ; Bumpmap
    map=img/lambobody_normal.tga
    ; Don't convert from SRGB to linear
    mode=linear
  }
  layer2
  {
    ; Reflection cubemap
    map=$trackenvmap
    mode=linear
  }
}
XXXshader_gloss
{
  layer0
  {
    map=fresnel.tga
    texgen_s=sphere_map
    texgen_t=sphere_map
    emission=1 1 1 1
  }
  layer1
  {
    map=$trackenvmap
    texgen_s=reflection_map
    texgen_t=reflection_map
    texgen_r=reflection_map
    blendfunc=filter
  }
  layer2
  {
    map=img/lambobody.tga
    blendfunc=one src_alpha
    emission=0 0 0 1
    shininess=0
    specular=0 0 0 1
  }
}

shader_matte~vf_standard
{
  layer0
  {
    map=img/lambobody.tga
    shininess=0
    specular=0 0 0
  }
}


shader_glass~vf_reflect_window
{
  ;sort_offset=1
  reflect=4.0
  layer0
  {
    map=glass.tga
    blendfunc=blend
    ;blendfunc=one src_alpha
  }
  layer1
  {
    map=$trackenvmap
  }
}

shader_decal~vf_standard
{
  layer0
  {
    map=glass.tga
    shininess=0
    specular=0 0 0
    blendfunc=blend
  }
}

shader_underbody~vf_standard
{
  layer0
  {
    map=underbodytex.tga
    emission=0 0 0 1
    shininess=0
    specular=0 0 0 1
  }
}


shader_interior~vf_standard
{
  layer0
    {
      map=interior.tga
      emission=0 0 0 1
      shininess=0
      specular=0 0 0 1
    }
}

shader_wheelfront~vf_reflect
{
  reflect=0.8
  motion_blur=0
  layer0
  {
    map=tirerim.tga
    ;blendfunc=one src_alpha
    ;emission=0 0 0 1
    shininess=50
    specular=1 1 1
    ;ambient=1 1 1
    ;ambient=0.2 0.2 0.2
    diffuse=0.8 0.8 0.8
    ;ambient=1 1 1
  }
}

shader_wheelrear~vf_reflect
{
  reflect=0.8
  motion_blur=0
  layer0
  {
    map=tirerimrear.tga
    ;blendfunc=one src_alpha
    ;emission=0 0 0 1
    shininess=50
    specular=1 1 1
    diffuse=0.8 0.8 0.8
    ;ambient=1 1 1
  }
}


shader_wheelinside~vf_standard
{
  motion_blur=0
  layer0
    {
      map=tireriminside.tga
      emission=0 0 0 1
      shininess=0
      specular=0 0 0 1
    }
}

shader_disc
{
  motion_blur=0
  ; Brake disc
  layer0
  {
    map=brakedisktext.tga
    emission=0 0 0 1
    shininess=32
    specular=1 1 1 1
  }
  ; Brakedisc heat shader
  vertex_shader
  {
    file=dyn_standard_v.cg
  }
  fragment_shader
  {
    ; Burn heat through texture's alpha
    file=standard_heat_f.cg
  }
}

shader_tyre~vf_standard
{
  motion_blur=0
  layer0
  {
    map=tiretread.tga
    shininess=0
    specular=0 0 0
  }
}

shader_shadowmap~vf_standard
{
  layer0
    {
      map=shadowmap.tga
      emission=1 1 1 1
      shininess=0
      specular=0 0 0 1
      texenv=replace
    }
}


shader_brakelight~vf_standard
{
  layer0
    {
      map=brakelight.tga
      emission=1 1 1 1
      shininess=0
      specular=0 0 0 1
      blendfunc=blend
      texenv=replace
    }
}

shader_reverselight~vf_standard
{
  layer0
  {
    map=img/lambobody.tga
    blendfunc=add
    depthwrite=0
  }
}

shader_mirror~vf_standard
{	
  diffuse=0.1 0.1 0.1
  layer0
  {
    map=$mirror
    ;texscale_s=1
    ;texscale_r=1
    ;texscale_t=1
    ;emission=0.3 0.3 0.3 1
  }
}

;
; Collision.dof shaders
;
shader_hull~vf_standard
{
  layer0
  {
    ; Use a stub (re-used) map
    map=img/lambobody.tga
  }
}
