;
; Carlswood track shaders - for the non-Cg version
;

;
; Shaders
;
shader_road
{
  ;ambient=0.2 0.2 0.2
  ;ambient=0.5 0.5 0.5
  ambient=0.5 0.5 0.5
  diffuse=1 1 1
  ;diffuse=0.9 0.9 0.9
  ;emission=0.5 0.5 0.5
  layer0
  {
    map=road.tga
    ;mipmap=1
    ;mipmap_lod_bias=-1
  }
}
shader_road_tracks01
{
  layer0
  {
    ;texenv=replace
    map=road_tracks01.tga
    ; Dithering (but Z-buffered)
    ;alpha_to_coverage=1
    ; Don't write depth; we're a decal - that makes sure Racer renders the road first, then the tracks on top
    depthwrite=0
    ; Regular blending
    blendfunc=blend
    alphafunc=gequal 128
    ;depthwrite=0
    ;depthfunc=lequal
  }
}
shader_road_start
{
  ; Use same shader as road for specular etc
  layer0
  {
    map=road_start.tga
    ;mipmap=1
    ;mipmap_lod_bias=-1
    ;depthwrite=0
  }
}


shader_sky
{
  sky=1
  cull=none
  layer0
  {
    texenv=replace
    map=sky_clouds.tga
    ;depthfunc=always
    depthwrite=0
  }
}

shader_kerbs
{
  diffuse=1 1 1
  ;ambient=0 0 0
  specular=0.5 0.5 0.5
  shininess=30
  tangents=1
  layer0
  {
    map=kerb.tga
  }
}
shader_concrete02
{
  layer0
  {
    map=concrete02.tga
    ;mipmap=0
  }
}
shader_gravel
{
  layer0
  {
    map=gravel.tga
  }
}
shader_grass1a
{
  layer0
  {
    ;map=xs02.tga
    map=grass1a.tga
  }
}
shader_sand
{
  layer0
  {
    map=sand.tga
  }
}
shader_xs01
{
  layer0
  {
    map=xs01.tga
    ;mipmap=0
  }
}
shader_xs02
{
  layer0
  {
    map=xs02.tga
    ;mipmap=0
  }
}
shader_xsnd
{
  layer0
  {
    ;map=xs02.tga
    map=grass1a.tga
    ;mipmap=0
  }
}
shader_tree1
{
  layer0
  {
    map=tree1.tga
    alpha_to_coverage=1
    depthwrite=1
    ;blendfunc=blend
    alphafunc=gequal 128
    ; Avoid too much light difference based on direction
    ;diffuse=0 0 0
    ;diffuse=0.5 0.6 0.5 
    ;ambient=1 1 1
    ;diffuse=0.1 0.1 0.1
  }
}
shader_tree3
{
  layer0
  {
    map=tree3.tga
    alpha_to_coverage=1
    depthwrite=1
    ;blendfunc=blend
    alphafunc=gequal 128
    ;depthwrite=0
    ; Avoid too much light difference based on direction
    ;diffuse=0 0 0
    ;diffuse=0.5 0.6 0.5 
    ;ambient=1 1 1
    ;diffuse=0.1 0.1 0.1
  }
}
shader_tretp
{
  layer0
  {
    map=tretp.tga
    alpha_to_coverage=1
    depthwrite=1
    ;blendfunc=blend
    alphafunc=gequal 128
    ;depthwrite=0
    ; Avoid too much light difference based on direction
    ;diffuse=0 0 0
    ;diffuse=0.5 0.6 0.5
    ;ambient=1 1 1
    ;diffuse=0.1 0.1 0.1
  }
}
shader_tretopf
{
  layer0
  {
    map=tretopf.tga
    alpha_to_coverage=1
    depthwrite=1
    ;blendfunc=blend
    alphafunc=gequal 128
    ;depthwrite=0
    ; Avoid too much light difference based on direction
    ;ambient=1 1 1
    ;diffuse=0.5 0.5 0.5
    ;diffuse=0.1 0.1 0.1
  }
}
shader_woods01
{
  ; Trouble with sun behind trees if blended
  layer0
  {
    map=woods01.tga
    alpha_to_coverage=1
    alphafunc=gequal 128
    depthwrite=1
    ;blendfunc=blend
    wrap_t=clamp_to_edge
    depthwrite=1
    ; Avoid too much light difference based on direction
    ;diffuse=2.5 0.6 0.5
    ;ambient=1 1 1
    ;diffuse=0.1 0.1 0.1
  }
}
shader_twalltp
{
  layer0
  {
    map=twalltp.tga
    ;texenv=replace
  }
}
shader_twall
{
  layer0
  {
    map=twall.tga
    ;texenv=replace
  }
}
shader_signs
{
  layer0
  {
    map=signs.tga
    texenv=replace
  }
}

shader_fence02
{
  layer0
  {
    map=fence02.tga
    blendfunc=blend
    alphafunc=gequal 100
    shininess=128
    depthwrite=1 
    texenv=replace
  }
}
shader_iron_fence
{
  specular=1 1 1
  shininess=70
  layer0
  {
    ;blendfunc=one src_alpha
    map=iron_fence.tga
    ;shininess=128
    ;diffuse=1 1 1
    ;ambient=1 1 1
  }
}

shader_met_galv
{
  Xlayer0
  {
    texenv=replace
    map=$trackenvmap
    texgen_s=reflection_map
    texgen_t=reflection_map
    texgen_r=reflection_map
    diffuse=-1 -1 -1 1
    ambient=0.5 0.5 .05 1
  }
  layer0
  {
    ;blendfunc=one src_alpha
    map=met_galv.tga
    ;shininess=128
    ;specular=1 1 1
    ;diffuse=1 1 1
    ;ambient=1 1 1
    ;alphafunc=lequal 200
  }
}

shader_cone
{
  ; Cones (used to have the material 'shader_c_orange) in v0.8.2-
  layer0
  {
    map=c_orange.tga
  }
}
XXXshader_c_orange
{
  ; Cones (old material)
  layer0
  {
    map=c_orange.tga
  }
}

shader_wood_old
{
  ; Cones
  layer0
  {
    map=wood_old.tga
  }
}
shader_s_start
{
  ; Start sign
  layer0
  {
    map=s_start.tga
  }
}
shader_c_white
{
  layer0
  {
    map=c_white.tga
  }
}
shader_s_201m
{
  layer0
  {
    map=s_201m.tga
  }
}
shader_s_402m
{
  layer0
  {
    map=s_402m.tga
  }
}
shader_s_1000m
{
  layer0
  {
    map=s_1000m.tga
  }
}
shader_rock
{
  layer0
  {
    map=rock.tga
  }
}

;
; Multisub shader; in Racer v0.8.9, DOFs loaded with materials that only have submaterials
; are renamed internally as 'multisub'. Any material without a shader gets warned about,
; and this shader catches the top levels of multi/sub materials
;
shader_multisub
{
  layer0
  {
    ; Take any map
    map=rock.tga
  }
}
