;
; Vertex/fragment shader templates
;
vf_reflect
{
  ; Just reflection
  vertex_shader
  {
    file=dyn_standard_reflect_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_reflect_f.cg
  }
}

;vf_reflect_spec
;{
;  ; Reflection shader - specular controlled by texture alpha channel
;  vertex_shader
;  {
;    file=cg/dyn_standard_reflect_spec_v.cg
;  }
;  fragment_shader
;  {
;    file=cg/dyn_standard_reflect_spec_f.cg
;  }
;}

vf_glass
{
  ; Just reflection
  vertex_shader
  {
    file=dyn_standard_reflect_window_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_reflect_window_f.cg
  }
}

vf_chrome
{
  ; 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=cg/dyn_standard_bump_reflect_spec_v.cg
;  }
;  fragment_shader
;  {
;    file=cg/dyn_standard_bump_reflect_spec_f.cg
;  }
;}

vf_bump
{ 
  ; 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_detail_bump
{ 
  ; Texture+bumpmap+reflection map
  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_standard
{
  vertex_shader
  {
    file=dyn_standard_v.cg
  }
  fragment_shader
  {
    file=standard_f.cg
  }
}

;vf_standard_spec
;{
;;Non reflective shader with specular controlled via texture alpha channel
;  vertex_shader
;  {
;    file=dyn_standard_spec_v.cg
;  }
;  fragment_shader
;  {
;    file=standard_spec_f.cg
;  }
;}

;;;;;;;;START CAR SHADERS;;;;;;;;;

shader_body~vf_reflect
{
tangents=1
compression=0 ; bad artifacts if turned on
reflect=0.5
diffuse=1.0 1.0 1.0
ambient=0.6 0.6 0.6
shininess=12 ;metallic subsurface shininess, HDR sun reflections now do clearcoat specular
specular=1.8 0.4 0.6 ;1.3 0.2 0.4
;0.82 0.86 0.90 - Zircon
;1.3 1.3 1.3 ;anthracite/charcoal?
;1.5 1.2 1.1 ; Roman Bronze (RGB 79,64,55) - 0.5 reflect, 0.6 diffuse, 0.6 ambient
;1.2 1.2 1.5 ; good for dark steel colour (75,75,85) - lower ambient/diffuse to 0.6
; Jag Racing Green (0,24,12) = 0.4 1.0 0.8
;Carnival Red (RGB 64,0,0) = 1.3 0.2 0.4
;cull=none
layer0
{
  map=body.tga
 }
 layer1
{
  map=body_NRM.tga
 }
 layer2
  {
   map=$trackenvmap
   }
   layer3
   {
   map=noise.tga
   mipmap_lod_bias=-1 ;-2 ;load metallic noise texture - mipmap stops flecks blurring at too short distance
   }
}

shader_glass~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=glass.tga
  shininess=20
  blendfunc=blend
  specular=0.0 0.0 0.0 1.0 
  depthwrite=0
 }
 layer1
  {
   map=$trackenvmap
   depthwrite=0
   }
}

shader_glass_interior~vf_standard
{
diffuse=1.0 1.0 1.0
ambient=1.0 1.0 1.0
specular=0.0 0.0 0.0 ;no specular
shininess=24
  sort_offset=-1 ;prevents depth fighting with exterior windscreen polies
  layer0
  {
   map=glass_int.tga
   blendfunc=blend
   depthwrite=0
  }
  }

shader_chrome~vf_chrome
{
reflect=0.5 ;0.4
diffuse=1.0 1.0 1.0
ambient=0.7 0.7 0.7
shininess=64
specular=0.1 0.1 0.1 
;cull=none
layer0
{
  map=chrome.tga
  
 }
 layer1
  {
   map=$trackenvmap
   }
}

shader_mirror
{
cull=none
diffuse=0.1 0.1 0.1
layer0
{
    map=$mirror
;    texscale_s=1
;    texscale_r=1
;    texscale_t=1
;    emission=0.1 0.1 0.1 1
}
}
shader_chrome_mapped~vf_chrome
{
reflect=0.5 ;0.4
diffuse=1.0 1.0 1.0
ambient=0.7 0.7 0.7
shininess=64
specular=0.1 0.1 0.1
;cull=none
layer0
{
  map=body.tga
   
 }
 layer1
  {
   map=$trackenvmap
   }
}

shader_leaper~vf_chrome
{
reflect=0.3
diffuse=1.0 1.0 1.0
ambient=0.5 0.5 0.5
shininess=12
specular=0.5 0.5 0.5 
;cull=none
layer0
{
  map=body.tga
  
 }
 layer1
  {
   map=$trackenvmap
   }
}

shader_trim~vf_bump
{
tangents=1
ambient=0.3 0.3 0.3
diffuse=1.0 1.0 1.0
specular=0.3 0.3 0.3
shininess=46
;cull=none
layer0
{
map=trim.tga
}
layer1
{
map=trim_NRM.tga
;subtle bump texture
}
}

shader_trim_mapped~vf_bump
{
;shader for parts of matte trim mapped to body texture. Only scuttle panel and B pillar at the moment
tangents=1
ambient=0.3 0.3 0.3
diffuse=1.0 1.0 1.0
specular=0.3 0.3 0.3
shininess=46
;cull=none
layer0
{
map=body.tga
}
layer1
{
map=body_NRM.tga
}
}

shader_underbody~vf_standard
{
;TEMPORARY AMBIENT/DIFFUSE SETTINGS
ambient=0.2 0.2 0.2 
diffuse=0.4 0.4 0.4 
;cull=none
layer0
{
map=underbody.tga
}
}

shader_radiator~vf_standard
{
;shader for textured radiator behind grille, brighter than rest of underbody shader
ambient=0.4 0.4 0.4
diffuse=1.0 1.0 1.0
specular=0.4 0.4 0.4
shininess=24
cull=none
layer0
{
map=underbody.tga
}
}

shader_trans_mapped~vf_standard
{
;shader for small logos - boot badges, tax disc, security stickers etc
ambient=0.8 0.8 0.8
diffuse=1.0 1.0 1.0
specular=0.5 0.5 0.5
shininess=24
;cull=none
layer0
{
map=logos.tga
blendfunc=blend
alphafunc=gequal 128
depthwrite=1
}
}

shader_name~vf_standard
{
;shader for 'J A G U A R' logo on boot plinth
ambient=0.8 0.8 0.8
diffuse=1.0 1.0 1.0
specular=0.2 0.2 0.2
shininess=24
;cull=none
layer0
{
map=name.tga
blendfunc=blend
alphafunc=gequal 128
;depthwrite=0
}
}

shader_sundries~vf_reflect
{
;shader for reflective body trim items which are mapped to body tex. Rear lamps for instance
reflect=0.6
diffuse=1.0 1.0 1.0
ambient=0.5 0.5 0.5
shininess=32
specular=0.5 0.5 0.5
;cull=none
layer0
{
  map=body.tga 
 }
 layer1
  {
   map=$trackenvmap
   }
}

shader_headlamps_reflect~vf_chrome
{
;shader for inner headlamp bezels, didn't look quite right with normal reflect shader
reflect=0.2
diffuse=0.7 0.7 0.7
ambient=0.4 0.4 0.4
shininess=16
specular=0.1 0.1 0.1
;cull=none
layer0
{
  map=body.tga
 }
 layer1
  {
   map=$trackenvmap
   }
}


shader_plates~vf_standard
{
ambient=0.6 0.6 0.6
diffuse=1.0 1.0 1.0 ;reflective plates, lots of diffuse
specular=0.2 0.2 0.2
shininess=24
layer0
{
map=plates.tga
}
}

shader_headlamps~vf_reflect
{
reflect=0.3
ambient=0.8 0.8 0.8
diffuse=0.8 0.8 0.8
specular=0.4 0.4 0.4
shininess=24
layer0
{
map=body.tga
}
}

;;;;;;;;;;;;;;;INTERIOR SHADERS;;;;;;;;;;;

shader_console~vf_detail_bump
{
;~vf_standard_spec
tangents=1
compression=0
;Main interior leather shader, for seats, dashboard, centre console etc
;cull=none
ambient=0.6 0.6 0.6
diffuse=1.0 1.0 1.0 
shininess=42
specular=0.25 0.25 0.25
layer0
{
map=console.tga
}
layer1
{
map=leather_NRM.tga
}
}

shader_console_lod1~vf_standard
{
;similar shader but without bumpmapping
shininess=42
specular=0.25 0.25 0.25
diffuse=0.8 0.8 0.8
ambient=0.8 0.8 0.8
layer0
{
map=console.tga
}
}

shader_interior~vf_detail_bump
{
;~vf_standard_spec
tangents=1
compression=0
;Main interior leather shader, for seats, dashboard, centre console etc
;cull=none
shininess=42
specular=0.25 0.25 0.25
ambient=0.6 0.6 0.6
diffuse=1.0 1.0 1.0 
layer0
{
map=interior.tga
}
layer1
{
map=leather_NRM.tga
}
}

shader_interior_lod1~vf_standard
{
shininess=42
specular=0.25 0.25 0.25
ambient=0.6 0.6 0.6
diffuse=1.0 1.0 1.0 
layer0
{
map=interior.tga
}
}

shader_carpet~vf_standard
{
cull=none
layer0
{
map=carpet.tga
shininess=24
specular=0.1 0.1 0.1 1.0
}
}

shader_swheel~vf_bump
{
tangents=1
compression=0
ambient=0.6 0.6 0.6
diffuse=1.0 1.0 1.0 
specular=0.25 0.25 0.25 ;0.15 0.15 0.15
shininess=42 
;cull=none
layer0
{
map=swheel.tga
}
layer1
{
map=swheel_NRM.tga
}
}

shader_swheel_lod1~vf_standard
{
;similar shader but without bumpmapping
ambient=0.6 0.6 0.6
diffuse=1.0 1.0 1.0 
specular=0.25 0.25 0.25
shininess=42 
layer0
{
map=swheel.tga
}
}

shader_veneer~vf_reflect
{
compression=0 ;wood texture looks ugly with compression 
reflect=0.4
diffuse=0.7 0.7 0.7
ambient=0.4 0.4 0.4
;cull=none
layer0
{
  map=veneer.tga
 }
 layer1
  {
   map=$trackenvmap
   }
}

shader_interior_bright~vf_standard
{
;Shader for bright interior fittings, such as instrument surrounds 
;cull=none
shininess=32
specular=0.5 0.5 0.5
diffuse=1.0 1.0 1.0
ambient=0.4 0.4 0.4
layer0
{
map=interior.tga
}
}

;;;;;;;;;;;WHEEL SHADERS;;;;;

shader_wheel~vf_reflect
{
compression=0
reflect=0.3
diffuse=0.8 0.8 0.8
ambient=0.5 0.5 0.5
shininess=12
specular=0.26 0.24 0.30 
;cull=none
layer0
{
  map=wheel.tga
 }
 layer1
  {
   map=$trackenvmap
   }
}

shader_wheel_lod~vf_standard
{
;wheel LOD model shader, lower detail model/texture/shader than close-up model
;compression=0
;reflect=0.3
diffuse=0.8 0.8 0.8 ;1.0 1.0 1.0
ambient=0.5 0.5 0.5 ;0.3 0.3 0.3
shininess=12
specular=0.26 0.24 0.30 
;cull=none
layer0
{
  map=wheel_lod.tga
  blendfunc=blend 
  ;alpha'd for transparent bits
 }
}

shader_wheel_blur01~vf_standard
{
;compression=0
;reflect=0.3
diffuse=0.8 0.8 0.8 ;1.0 1.0 1.0
ambient=0.5 0.5 0.5 ;0.3 0.3 0.3
shininess=12
specular=0.26 0.24 0.30  
blendfunc=blend
;cull=none
layer0
{
  map=wheel_blur01.tga
  blendfunc=blend
  alphafunc=gequal 12
 }
}

shader_wheel_blur02~vf_standard
{
;compression=0
;reflect=0.3
diffuse=0.8 0.8 0.8 ;1.0 1.0 1.0
ambient=0.5 0.5 0.5 ;0.3 0.3 0.3
shininess=12
specular=0.26 0.24 0.30  
blendfunc=blend
;cull=none
layer0
{
  map=wheel_blur02.tga
  blendfunc=blend
  alphafunc=gequal 12
 }
}


shader_tread~vf_bump
{
tangents=1
compression=0
ambient=0.5 0.5 0.5
diffuse=1.0 1.0 1.0
specular=0.1 0.1 0.1
shininess=24 ;tread part of tyre is less shiny
layer0
{
map=tread.tga
}
layer1
{
map=tread_NRM.tga
}
}

shader_tread_blur01~vf_standard
{
;Only need a single tyre tread blur texture, this shader is used on both sets of blur models
ambient=0.5 0.5 0.5
diffuse=1.0 1.0 1.0
specular=0.1 0.1 0.1
shininess=24
layer0
{
map=tread_blur01.tga
}
}

shader_tyre~vf_bump
{
tangents=1
compression=0
ambient=0.5 0.5 0.5
diffuse=1.0 1.0 1.0
specular=0.2 0.2 0.2
shininess=42
layer0
{
      map=tyre.tga
}
layer1
{
map=tyre_NRM.tga
}
}

shader_tyre_blur01~vf_standard
{
ambient=0.5 0.5 0.5
diffuse=1.0 1.0 1.0
specular=0.2 0.2 0.2
shininess=42
layer0
{
      map=tyre_blur01.tga
}
}

shader_tyre_blur02~vf_standard
{
ambient=0.5 0.5 0.5
diffuse=1.0 1.0 1.0
specular=0.2 0.2 0.2
shininess=42
layer0
{
      map=tyre_blur02.tga
}
}

shader_brakedisc
{
  motion_blur=0
  ; Brake disc
  layer0
  {
    map=brakedisc.tga
    emission=0.5 0.5 0.5 1
    shininess=32
    specular=1 1 1 1
  }
  ; Brakedisc heat shader
  vertex_shader
  {
    file=dyn_standard_v.cg
  }
  fragment_shader
  {
    ; Use disc heat global shader
    file=standard_heat_f.cg
  }
}

shader_caliper~vf_bump
{
tangents=1
conpression=0
ambient=0.5 0.5 0.5
diffuse=1.0 1.0 1.0
specular=0.2 0.2 0.2
shininess=16
layer0
   {
      map=caliper.tga
  }
  layer1
  {
  map=caliper_NRM.tga
  }
}

;;;;;;;;;;;;;;EMISSIVE LAMP SHADERS;;;;;;;;

shader_brakelamps_lit~vf_standard
{
sort_offset=2
layer0
{
;uses separate shader to prevent depth fighting with tail lamps
blendfunc=blend
depthwrite=0
;alphafunc=gequal 10
diffuse=1.0 0.4 0.01 1.0
emission=1.0 0.4 0.01 1.0
map=lamps.tga
}
}
shader_headlamps_lit~vf_standard
{
sort_offset=1
layer0
{
depthwrite=0
blendfunc=blend
;alphafunc=gequal 2
emission=1.0 0.86 0.78 1.0
diffuse=1.0 0.86 0.78 1.0
map=lamps.tga
}
}

shader_tail_lamps_lit~vf_standard
{
sort_offset=1
layer0
{
depthwrite=0
blendfunc=blend
;alphafunc=gequal 2
emission=1.0 0.4 0.01 1.0
diffuse=1.0 0.4 0.01 1.0
map=lamps.tga
}
}

shader_license_plate_lit~vf_standard
{
sort_offset=1
layer0
{
depthwrite=0
blendfunc=blend
;alphafunc=gequal 2
emission=1.0 0.80 0.64 1.0
map=light1.tga
}
}
  
shader_lights~vf_standard
{
;AMG's lights shader I think??
  sort_offset=1
  layer0
    {
       map=lights_interior.tga
       blendfunc=add
       ;texenv=replace
       emission=1 1 1 1
    }
}

;;;;;;;;;DRIVER MODEL SHADER;;;;;;

shader_driver~vf_standard
{
compression=0
ambient=0.6 0.6 0.6
diffuse=1.0 1.0 1.0
specular=0.05 0.05 0.05
shininess=16
  layer0
  {
    map=maledriver.tga
  }
}

;;;;;;;;;;COLLISION/SHADOW MODEL SHADERS;;;;;;;

shader_shadow
{
;Shader for 3D shadow model
layer0
{
map=shadow.tga
blendfunc=blend
}
}

shader_collision
{
;Newton collision model needs shader to prevent Qlog errors?
layer0
{
map=shadow.tga
blendfunc=blend
}
}