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

  1. !!FP1.0
  2. # NV_fragment_program generated by NVIDIA Cg compiler
  3. # cgc version 1.5.0001, build date Oct 15 2002  01:04:08
  4. # command line args: -profile fp30
  5. #vendor NVIDIA Corporation
  6. #version 1.0.1
  7. #profile fp30
  8. #program main
  9. #semantic main.skinColor_frontSpec
  10. #semantic main.skin_norm_sideSpec
  11. #semantic main.g_specular_colorShift
  12. #semantic main.g_blood_texture
  13. #semantic main.g_transmission_terms
  14. #semantic main.g_diffuse_Cube
  15. #semantic main.g_specular_Cube
  16. #semantic main.g_nrmalize_Cube
  17. #semantic main.g_dappleProjection
  18. #semantic main.g_hilight_Cube
  19. #var float4 v2f.skinColor_frontSpec : $vin.TEXCOORD0 : TEXCOORD0 : 0 : 1
  20. #var float3 v2f.worldEyeDir       : $vin.TEXCOORD2 : TEXCOORD2 : 0 : 1
  21. #var float3 v2f.worldTanMatrixX        : $vin.TEXCOORD5 : TEXCOORD5 : 0 : 1
  22. #var float3 v2f.worldTanMatrixY        : $vin.TEXCOORD6 : TEXCOORD6 : 0 : 1
  23. #var float3 v2f.worldTanMatrixZ        : $vin.TEXCOORD7 : TEXCOORD7 : 0 : 1
  24. #var float4 v2f.SkinSilouetteVec    : $vin.TEXCOORD3 : TEXCOORD3 : 0 : 1
  25. #var samplerRECT skinColor_frontSpec :  : texunit 0 : 1 : 1
  26. #var samplerRECT skin_norm_sideSpec  :  : texunit 1 : 2 : 1
  27. #var samplerRECT g_specular_colorShift :  : texunit 2 : 3 : 1
  28. #var samplerRECT g_blood_texture          :  : texunit 3 : 4 : 1
  29. #var samplerRECT g_transmission_terms  :  : texunit 4 : 5 : 1
  30. #var samplerCUBE g_diffuse_Cube          :  : texunit 5 : 6 : 1
  31. #var samplerCUBE g_specular_Cube       :  : texunit 6 : 7 : 1
  32. #var samplerCUBE g_nrmalize_Cube       :  : texunit 7 : 8 : 1
  33. #var samplerRECT g_dappleProjection    :  : texunit 8 : 9 : 1
  34. #var samplerCUBE g_hilight_Cube        :  : texunit 9 : 10 : 1
  35. #var half4 COL : $vout.COLOR : COLOR : -1 : 1
  36.  
  37. DEFINE LUMINANCE = {0.299, 0.587, 0.114, 0.0};
  38.  
  39. ############################################################################################
  40. #  These two blocks slow code down 10%                                                     #
  41. ############################################################################################
  42. TEX H0, f[TEX0], TEX1, 2D;                  # store range-compressed normal (and side spec) in H1
  43. TEX H1, f[TEX0], TEX0, 2D;                  # store skin color in H3
  44.  
  45. DP3H H2.x, H0, f[TEX5];
  46. DP3H H2.y, H0, f[TEX6];
  47. DP3H H2.z, H0, f[TEX7];                     # H2 now contains worldNormal - extinguish
  48.  
  49. MOVH H0, f[TEX2];                           # store v2f.world_V in H1
  50. DP3X H2.w, H0, H2;                          # H2.w = dot(Normal, View)
  51. MULX H2.xyz,-H2, -2;                        # twice the normal
  52. MADX H3.xyz, -H2, H2.w, H0;                 # H4 = -2*dot(H0, H2)*H2 + H0  = reflection vector.  Normal doesn't need to be fixed, because it's uniformly scaled
  53.  
  54. TEX H0, H2, TEX5, CUBE;                     # diffuse lighting
  55. TEX H2, H3, TEX9, CUBE;                     # direct specular lighting
  56.  
  57. MULX H2.xyz, H2, 0.3;                       # const*spec
  58. MULX H0, H0, H1;                            # diffuse_map*diffuse
  59. MADX o[COLH], H0, 0.7, H2;                  # diffuse and spec
  60.  
  61. END
  62.  
  63. # End of program
  64.  
  65.  
  66.  
  67.  
  68.  
  69.