home *** CD-ROM | disk | FTP | other *** search
/ NVIDIA Tech Demo: DAWN / NVIDIA_demo.iso / Dawn.exe / Disk1 / data1.cab / Program_Executable_Files / shaders / eye_outer.fp30 < prev    next >
Encoding:
Text File  |  2003-02-11  |  870 b   |  28 lines

  1. // wpos, a texture coordinate, and tangent space light vectors
  2. struct v2fConnector : vertex2fragment  {
  3.   float2 diffCol          :TEX0;
  4.   float3 worldEyeDir      :TEX1;
  5.   float3 worldNormal      :TEX2;
  6. };
  7.  
  8. // output a color
  9. struct f2fConnector : fragment2framebuffer  {
  10.   half3 COL;
  11. };
  12.  
  13. f2fConnector main(v2fConnector v2f,
  14.                   uniform texobj2D   diffCol,
  15.                   uniform texobjCUBE g_diffuse_Cube,
  16.                   uniform texobjCUBE g_specular_Cube,
  17.                   uniform texobjCUBE g_nrmalize_Cube,
  18.                   uniform texobjCUBE g_hilight_Cube){
  19.   f2fConnector f2f;
  20.  
  21.   half3 refl = reflect(v2f.worldEyeDir, v2f.worldNormal);
  22.   half3 cube_specular = f3texCUBE(g_specular_Cube, refl);
  23.   half3 cube_hilight  = f3texCUBE(g_hilight_Cube, refl); 
  24.  
  25.   f2f.COL = 0.2*cube_specular + cube_hilight;
  26.   return f2f;
  27. }
  28.