home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 January / Gamestar_80_2006-01_dvd.iso / Dema / splatmagazinerenegadepaintball_demo.exe / VShader072-000419431467.vsh < prev    next >
Text File  |  2005-10-13  |  3KB  |  97 lines

  1. ; This source file can be requested from NVLink.
  2. ; It could be re-assembled as a shader, but note that
  3. ; NVLink has already assembled this file into D3D opcodes
  4. ; You can ask NVLink for the constant and vertex slots from the API.
  5.  
  6. ; Total Instructions: 30
  7. ; Instructions removed by optimizer: 3
  8. ; Used Constants: 13
  9. ; Used Vertex Slots: 0
  10. ; Used Registers: 6
  11.  
  12. #define c_constants 0
  13. #define c_decompress_object_scale 1
  14. #define c_ambient_light 6
  15. #define c_worldviewprojection_0 2
  16. #define c_worldviewprojection_1 3
  17. #define c_worldviewprojection_2 4
  18. #define c_worldviewprojection_3 5
  19. #define c_fogconst 8
  20. #define c_pointlight_diffuse 12
  21. #define c_dirlight_diffuse 10
  22. #define c_objectspace_eyeposition 7
  23. #define c_dirlight_direction 9
  24. #define c_pointlight_position 11
  25.  
  26. vs.1.0
  27.  
  28. ; f_move_uncompressed_position
  29.  
  30. ; f_decompress_normal
  31. mad r1, v3, c[c_constants].zzzz, -c[c_constants].yyyy
  32.  
  33. ; f_decompress_texture0
  34. mad r2.xy, v2.ywww, c[c_constants].wwww, v2.xzzz
  35. mad oT0.xy, r2.xyyy, c[c_decompress_object_scale].zzzz, -c[c_decompress_object_scale].wwww
  36.  
  37. ; f_move_fixed_localposition
  38. mov r0, v0
  39.  
  40. ; f_move_fixed_localnormal
  41.  
  42. ; f_outputobjectpos_clipspace
  43. mov r0.w, c[c_constants].yyyy
  44. dp4 oPos.x, r0, c[c_worldviewprojection_0]
  45. dp4 oPos.y, r0, c[c_worldviewprojection_1]
  46. dp4 oPos.z, r0, c[c_worldviewprojection_2]
  47. dp4 oPos.w, r0, c[c_worldviewprojection_3]
  48.  
  49. ; f_set_ambient
  50. mov r3, c[c_ambient_light]
  51.  
  52. ; f_create_objectspace_eyevector_local_viewer
  53. add r4, r0, -c[c_objectspace_eyeposition]
  54. dp3 r4.w, r4, r4
  55. rsq r5.w, r4.wwww
  56. mul r4, -r4, r5.wwww
  57.  
  58. ; f_calculate_linear_range_fog
  59. rcp r5.w, r5.wwww
  60. add r5.x, c[c_fogconst].yyyy, -r5.wwww
  61. mul r5.x, r5.xxxx, c[c_fogconst].zzzz
  62. add oFog, r5.xxxx, -c[c_fogconst].xxxx
  63.  
  64. ; f_calculate_objectspace_directionallight_diffuse_intensity
  65. dp3 r5, r1, c[c_dirlight_direction]
  66.  
  67. ; f_clamp_diffuse_exponentiate_specular
  68. lit r5, r5
  69.  
  70. ; f_dirlight_accumulate_diffuse
  71. mad r5, r5.yyyy, c[c_dirlight_diffuse], r3
  72.  
  73. ; f_calculate_objectspace_pointlight_vector
  74. add r0, c[c_pointlight_position], -r0
  75. dp3 r0.w, r0, r0
  76. rsq r0.w, r0.wwww
  77. mul r0, r0, r0.wwww
  78.  
  79. ; f_calculate_objectspace_pointlight_diffuse_intensity
  80. dp3 r1, r1, r0
  81.  
  82. ; f_clamp_diffuse_exponentiate_specular
  83. lit r1, r1
  84.  
  85. ; f_pointlight_accumulate_diffuse
  86. mad r1, r1.yyyy, c[c_pointlight_diffuse], r5
  87.  
  88. ; f_write_default_texture
  89.  
  90. ; f_set_diffuse_alpha_ambient
  91. mov oD0.w, c[c_ambient_light].wwww
  92.  
  93. ; f_write_diffuse_result
  94. mov oD0.xyz, r1
  95.  
  96. ; end
  97.