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

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