; filename track.shd for sndtest
; after shader_ put filename of images used
; sndtest track shaders by boomer541, June 12, 2005. Updated Jan 28, 2009
; water textures from http://www.noctua-graphics.de, stop.jpg grass from Got_3d, gravel from 
; photoshoptextures.com others from other tracks, internet or me I don't remember where 
; exactly.  Another senior moment

; =============================================================================
; shader subtrees for later reference
; =============================================================================
;    mipmap=0   ; 0 gives shaky fence, 1 is default
;    texenv=replace
;    ambient=1 1 1 1
; sun reflection off track can be made in Blender
; sun reflection sun_xx.tga images determine location of sun for sun reflection
;_sun
;  {
;    map=$tracksunmap
;    texgen_s=reflection_map
;    texgen_t=reflection_map
;    texgen_r=reflection_map
;    emission=-0.4 -0.4 -0.4 1
;  }
; Vertex/fragment templates

vf_wave_flag
 {
  vertex_shader
  {
    file=standard_wave_v.cg
  }
  fragment_shader
  {
    file=standard_wave_f.cg
  }
 }
vf_bump
{
  vertex_shader
  {
;    file=standard_bump_v.cg
    file=cg/bump_v.cg
  }
  fragment_shader
  {
;    file=standard_bump_f.cg
    file=cg/bump_f.cg
  }
}
vf_standard
{
  ; Most-often used shader
  vertex_shader 
  {
    file=standard_v.cg
  }
  fragment_shader
  {
    file=standard_f.cg
  }
}
;vf_check
;{
;  vertex_shader 
;  {
;    file=standard_v.cg
;  }
;  fragment_shader
;  {
;    file=check_shader_f.cg
;  }
;}
vf_standard_vc
{
  ; Carlswood shader
  ; Carlswood uses vertex coloring. Other tracks may use 'standard_v.cg' and 'standard_f.cg'.
  vertex_shader 
  {
    file=standard_vc_v.cg
  }
  fragment_shader
  {
    file=standard_vc_f.cg
  }
}
vf_animate
{
  ; Animation test (top moves around)
  vertex_shader 
  {
    file=animate_test_v.cg
  }
  fragment_shader
  {
    file=standard_f.cg
  }
}
vf_road
{
  ; The road uses specularity but burned through the red channel to get a coarse gloss map
  vertex_shader 
  {
    file=standard_v.cg
  }
  fragment_shader
  {
    ; Burn specularity through red
    file=standard_burn_f.cg
  }
}
;vf_shadow
;{
;  vertex_shader
;  {
;    file=shadow_v.cg
;  }
;  fragment_shader
;  {
;    file=shadow_f.cg
;  }
;}
vf_sky
{
  vertex_shader
  {
    file=sky_daynight_v.cg
;    file=sky_v.cg
  }
  fragment_shader
  {
    file=sky_daynight_f.cg
;    file=sky_f.cg
  }
}
;
; Shaders
;
; =============================================================================
; here there be shaders ...
; =============================================================================
; compression=0
;shader_sky
;{
;  cull=back
;  sky=1
;;  fog=0
;  layer0
;  {
;    texenv=replace
;    map=sky.tga
;    depthwrite=0
;    depthfunc=always
;    mipmap=1
;  }
;}
shader_sky~vf_sky
{
    sky=1
;    fog=0
    cull=none
  layer0
  {
    map=sky.jpg
    depthwrite=1   ;0
    shininess=1
  }
  layer1
  {
    map=sky_night.jpg
    depthwrite=1   ;0
    shininess=1
  }
}
shader_usa_flag~vf_wave_flag
{
  cull=none
;  cull=back
  layer0
  {
    map=usa_flag.jpg
    diffuse=0.9 0.9 0.9
    shininess=1
  }
}
;shader_road
;{
;  layer0~_sun
;  layer1
;  {
;    mipmap=1  ; set=0 for non blured
;    map=road.tga
;    blendfunc=src_alpha src_color
;  }
;}
shader_road~vf_road
{
  ambient=0.2 0.2 0.2
  ;ambient=0.5 0.5 0.5
  ;emission=0.5 0.5 0.5
  diffuse=0.9 0.9 0.9
  specular=0.5 0.5 0.5
  shininess=4
  layer0
  {
    map=road.jpg
    mipmap=1
    mipmap_lod_bias=-1
  }
}
shader_brake~vf_road
{
  ambient=0.2 0.2 0.2
  ;ambient=0.5 0.5 0.5
  ;emission=0.5 0.5 0.5
  diffuse=0.9 0.9 0.9
  specular=0.5 0.5 0.5
  shininess=4
  layer0
  {
    map=brake.jpg
    mipmap=1
    mipmap_lod_bias=-1
  }
}
shader_cone~vf_standard
{
  ; Cones (used to have the material 'shader_c_orange) in v0.8.2-
;  tangents=1
  layer0
  {
    map=cone.tga
    shininess=1
  }
}
shader_cube~vf_standard
{
  layer0
  {
    map=cube.jpg
    shininess=1
  }
  layer1
  {
    map=cube_n.jpg
    shininess=1
  }
;  vertex_shader
;  {
;;    file=cg/wobble1_v.cg
;;    file=cg/bump_v.cg
;    file=standard_bump_v.cg
;;    file=cg/wavy.road_tracks_v.cg
;  }
;  fragment_shader
;  {
;;    file=cg/wobble1_f.cg
;;    file=cg/bump_f.cg
;    file=standard_bump_f.cg
;  }
}
shader_crowd~vf_standard
{
  cull=none
  shininess=0
  layer0
  {
    map=crowd.tga
    alphafunc=greater 128
  }
}
shader_curb~vf_bump
{
  shininess=1
  layer0
  {
    map=curb.jpg
  }
  layer1
  {
    map=curb_n.jpg
  }
}
shader_brarete~vf_standard
{
  compression=0
  sort_offset=50
  cull=none
  shininess=1
  layer0
  {
    map=brarete.tga
    blendfunc=blend
;    blendfunc=one one_minus_dst_alpha
    alphafunc=greater 40
;    ambient=0.4 0.5 0.6 1
    wrap_t=clamp_to_edge
  }
}
shader_fence~vf_standard
{
  compression=0
  sort_offset=51
  cull=none
  shininess=1
  layer0
  {
    map=fence.tga
    blendfunc=blend
;    blendfunc=one one_minus_dst_alpha
    alphafunc=greater 40
;    ambient=0.4 0.5 0.6 1
    wrap_t=clamp_to_edge
  }
}
shader_fence_3~vf_standard
{
  compression=0
  sort_offset=52
  cull=none
  shininess=1
  layer0
  {
    map=fence_3.tga
    blendfunc=blend
;    blendfunc=one one_minus_dst_alpha
    alphafunc=greater 40
;    ambient=0.4 0.5 0.6 1
    wrap_t=clamp_to_edge
  }
}
shader_grass~vf_standard_vc
{
  shininess=1
  layer0
  {
    map=grass.jpg
  }
;  layer1
;  {
;    map=grass_n.jpg
;  }
}
shader_gravel~vf_bump
{
  ambient=1 1 1 1
  shininess=1
  layer0
  {
    map=gravel.jpg
  }
  layer1
  {
    map=gravel_n.jpg
  }
}
shader_hill~vf_bump
{
  shininess=1
  layer0
  {
    map=hill.jpg
  }
  layer1
  {
    map=hill_n.jpg
  }
}

shader_ice~vf_standard
{
  shininess=1
  layer0
  {
    map=ice.tga
  }
;  layer1
;  {
;    map=ice_n.jpg
;  }
}
shader_snow~vf_standard
{
  shininess=1
  layer0
  {
    map=snow.tga
  }
;  layer1
;  {
;    map=snow_n.jpg
;  }
}
shader_mud~vf_bump
{
  shininess=1
  layer0
  {
    map=mud.jpg
  }
  layer1
  {
    map=mud_n.jpg
  }
}
shader_sand~vf_standard
{
  shininess=1
  layer0
  {
    map=sand.tga
  }
;  layer1
;  {
;    map=sand_n.jpg
;  }
}
shader_signs~vf_standard
{
  shininess=1
  layer0
  {
    map=signs.tga
  }
}
shader_stone~vf_bump
{
  shininess=1
  layer0
  {
    map=stone.jpg
  }
  layer1
  {
    map=stone_n.jpg
  }
}
shader_stop~vf_standard
{
  shininess=1
  layer0
  {
    map=stop.jpg
  }
}
shader_waterb~vf_standard
{
  sort_offset=47
;  shininess=1
  layer0
  {
    map=waterb.tga
  shininess=1
  }
}
shader_waterc
{
  compression=0
  cull=none
  sort_offset=49
  layer0
  {
    map=waterc.tga
    blendfunc=blend
    alphafunc=greater 187 ;number is alpha value +11 or more (176+11) to make water transparent
    shininess=1
;    depthwrite=0   ;1 is default
  }
  layer1
  {
    map=$trackenvmap
    texgen_s=reflection_map
    texgen_t=reflection_map
    texgen_r=reflection_map
    blendfunc=src_color one_minus_src_color
    shininess=1
  }
  layer2
  {
    map=waterc.tga
    alphafunc=notequal 176   ;notequal to alpha value (176) for color,  = for no color
;    blendfunc=blend
;    blendfunc=one one_minus_dst_alpha
    blendfunc=src_alpha one_minus_src_alpha
    ambient=0.0 0.3 0.8 1  ; colors all pixels not=alpha(176), - numbers make darker
    shininess=1
  }
}
shader_water_n~vf_standard
{
  compression=0
  sort_offset=48
  cull=none
  layer0
  {
    map=water_n.tga
    blendfunc=blend
    alphafunc=greater 143
    wrap_t=clamp_to_edge
    depthwrite=1
    shininess=1
  }
}
shader_tree~vf_animate
{
  shininess=1
  layer0
  {
    map=tree.tga
    alpha_to_coverage=1
    depthwrite=1
    ; Avoid too much light difference based on direction
    diffuse=0.5 0.6 0.5 
    ;diffuse=0.1 0.1 0.1
  }
}
shader_treeleaf2~vf_standard
{
cull=none
  vertex_shader
  {
    file=cg/treesa_v.cg
  }
  fragment_shader
  {
    file=cg/trees_f.cg
  }
  layer0
  {
   ;mipmap=1
   ;mipmap_lod_bias=-1.0
   map=tree083.tga
   ;wrap_t=clamp_to_edge
   alphafunc=greater 128
  }
  layer1
  {
   ;mipmap=1
   ;mipmap_lod_bias=-1.0
   map=tree083n.tga
   alphafunc=greater 128
   shininess=1
  }
}
shader_treetrunk~vf_standard
{
  shininess=1
  layer0
  {
    map=TreeBark.tga
  }
}
shader_post~vf_standard
{
  cull=none
  shininess=1
  layer0
  {
    map=post.tga
  }
}
shader_rail~vf_standard
{
   sort_offset=49
   cull=none
  shininess=1
   layer0
  {
    map=rail.tga
    blendfunc=blend
    alphafunc=greater 0
    depthwrite=1
;    ambient=0.5 0.5 0.5
  }
}