home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 14 / Example 14.1 / Debug / Shaders / FogOfWar.ps < prev    next >
Encoding:
Text File  |  2006-06-22  |  842 b   |  20 lines

  1. //////////////////////////////////////////////////////////////////////////
  2. //                                                                      //
  3. //                      Fog-of-War Vertexshader                         //
  4. //                                                                      //
  5. //                   Written by C. Granberg, 2006                       //
  6. //                                                                      //
  7. //////////////////////////////////////////////////////////////////////////
  8.  
  9. sampler visibleTexture;
  10. sampler visitedTexture;
  11. sampler lightMap;
  12.  
  13. float4 Main(float2 UV : TEXCOORD0) : COLOR
  14. {
  15.     float4 c0 = tex2D(visibleTexture, UV);
  16.     float4 c1 = tex2D(visitedTexture, UV) * 0.5f;
  17.     float4 c2 = tex2D(lightMap, UV);
  18.  
  19.     return float4(max(c0.rgb, c1.rgb), 1.0f) * c2.a;
  20. }