home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 5 / Example 5.10 / Debug / Shaders / objects.ps next >
Encoding:
Text File  |  2006-06-22  |  843 b   |  21 lines

  1. //////////////////////////////////////////////////////////////////////////
  2. //                                                                      //
  3. //                    Terrain Object Pixexlshader                       //
  4. //                                                                      //
  5. //                    Written by C. Granberg, 2006                      //
  6. //                                                                      //
  7. //////////////////////////////////////////////////////////////////////////
  8.  
  9.  
  10. sampler diffuseText;
  11. sampler light;
  12.  
  13. float4 Main(float2 UV : TEXCOORD0, float2 worldUV : TEXCOORD1, float shade : TEXCOORD2) : COLOR
  14. {
  15.     //Sample the textures
  16.     float4 col  = tex2D(diffuseText, UV);
  17.     float4 l    = tex2D(light, worldUV); 
  18.  
  19.     //Return result
  20.     return col * shade * l;
  21. }