home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 January / Gamestar_80_2006-01_dvd.iso / Dema / splatmagazinerenegadepaintball_demo.exe / VShader072-000134227279.vsh < prev    next >
Text File  |  2005-10-13  |  5KB  |  179 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: 78
  7. ; Instructions removed by optimizer: 3
  8. ; Used Constants: 27
  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_screen_const 3
  15. #define c_ambient_light 13
  16. #define c_worldviewprojection_0 9
  17. #define c_worldviewprojection_1 10
  18. #define c_worldviewprojection_2 11
  19. #define c_worldviewprojection_3 12
  20. #define c_cubematrix_0 16
  21. #define c_cubematrix_1 17
  22. #define c_cubematrix_2 18
  23. #define c_fogconst 15
  24. #define c_pointlight_diffuse_0 24
  25. #define c_pointlight_diffuse_1 26
  26. #define c_dirlight_diffuse_0 20
  27. #define c_dirlight_diffuse_1 22
  28. #define c_objectspace_eyeposition 14
  29. #define c_dirlight_direction_0 19
  30. #define c_dirlight_direction_1 21
  31. #define c_pointlight_position_0 23
  32. #define c_pointlight_position_1 25
  33. #define c_wavewarp_ref1 2
  34. #define c_wavewarp_ref2 4
  35. #define c_wavewarp_amt1 5
  36. #define c_wavewarp_amt2 6
  37. #define c_wavewarp_dir1 7
  38. #define c_wavewarp_dir2 8
  39.  
  40. vs.1.1
  41.  
  42. ; f_decompress_position
  43. mad r0.xy, v0.ywww, c[c_constants].wwww, v0.xzzz
  44. mad r0.zw, v1.yyyy, c[c_constants].wwww, v1.xxxx
  45. mad r0.xyz, r0.xyzz, c[c_decompress_object_scale].xxxx, -c[c_decompress_object_scale].yyyy
  46. mov r0.w, c[c_constants].yyyy
  47.  
  48. ; f_decompress_normal
  49. mad r1, v3, c[c_constants].zzzz, -c[c_constants].yyyy
  50.  
  51. ; f_decompress_texture0
  52. mad r2.xy, v2.ywww, c[c_constants].wwww, v2.xzzz
  53. mad oT0.xy, r2.xyyy, c[c_decompress_object_scale].zzzz, -c[c_decompress_object_scale].wwww
  54.  
  55. ; f_move_fixed_localposition
  56.  
  57. ; f_move_fixed_localnormal
  58.  
  59. ; f_wavewarp
  60. dp4 r3.w, r0, c[c_wavewarp_ref1]
  61. expp r4.y, r3.wwww
  62. mad r4.x, r4.yyyy, c[c_constants].zzzz, -c[c_constants].yyyy
  63. mad r3.w, c[c_screen_const].xxxx, c[c_screen_const].xxxx, r3.wwww
  64. expp r3.y, r3.wwww
  65. mad r4.y, r3.yyyy, c[c_constants].zzzz, -c[c_constants].yyyy
  66. dp4 r3.w, r0, c[c_wavewarp_ref2]
  67. expp r5.y, r3.wwww
  68. mad r4.z, r5.yyyy, c[c_constants].zzzz, -c[c_constants].yyyy
  69. mad r3.w, c[c_screen_const].xxxx, c[c_screen_const].xxxx, r3.wwww
  70. expp r3.y, r3.wwww
  71. mad r4.w, r3.yyyy, c[c_constants].zzzz, -c[c_constants].yyyy
  72. mul r3, r4, r4
  73. mad r3, r3, r4, -r4
  74. mul r4.xyz, c[c_wavewarp_amt1].xyzz, v15.xyzz
  75. mul r5.xyz, c[c_wavewarp_amt2].xyzz, v15.xyzz
  76. mad r0.xyz, r4.xyzz, r3.xxxx, r0.xyzz
  77. mad r0.xyz, r5.xyzz, r3.zzzz, r0.xyzz
  78. dp3 r4.x, r1.xyzz, r4.xyzz
  79. mul r4.x, r4.xxxx, r3.yyyy
  80. mul r4.x, r4.xxxx, c[c_wavewarp_dir1].wwww
  81. dp3 r4.y, r1.xyzz, r5.xyzz
  82. mul r4.y, r4.yyyy, r3.wwww
  83. mul r4.y, r4.yyyy, c[c_wavewarp_dir2].wwww
  84. mad r1.xyz, c[c_wavewarp_dir1].xyzz, -r4.xxxx, r1.xyzz
  85. mad r4.xyz, c[c_wavewarp_dir2].xyzz, -r4.yyyy, r1.xyzz
  86. dp3 r4.w, r4.xyzz, r4.xyzz
  87. rsq r4.w, r4.wwww
  88. mul r4, r4, r4.wwww
  89.  
  90. ; f_outputobjectpos_clipspace
  91. mov r0.w, c[c_constants].yyyy
  92. dp4 oPos.x, r0, c[c_worldviewprojection_0]
  93. dp4 oPos.y, r0, c[c_worldviewprojection_1]
  94. dp4 oPos.z, r0, c[c_worldviewprojection_2]
  95. dp4 oPos.w, r0, c[c_worldviewprojection_3]
  96.  
  97. ; f_set_ambient
  98. mov r1, c[c_ambient_light]
  99.  
  100. ; f_create_objectspace_eyevector_local_viewer
  101. add r3, r0, -c[c_objectspace_eyeposition]
  102. dp3 r3.w, r3, r3
  103. rsq r5.w, r3.wwww
  104. mul r3, -r3, r5.wwww
  105.  
  106. ; f_calculate_linear_range_fog
  107. rcp r5.w, r5.wwww
  108. add r5.x, c[c_fogconst].yyyy, -r5.wwww
  109. mul r5.x, r5.xxxx, c[c_fogconst].zzzz
  110. add oFog, r5.xxxx, -c[c_fogconst].xxxx
  111.  
  112. ; f_calculate_objectspace_reflection
  113. dp3 r5.xyz, r3.xyzz, r4.xyzz
  114. add r5.xyz, -r5.xyzz, -r5.xyzz
  115. mad r5.xyz, r4.xyzz, -r5.xyzz, -r3.xyzz
  116.  
  117. ; f_calculate_cubereflection_vector_t1
  118. dp3 oT1.x, r5, c[c_cubematrix_0]
  119. dp3 oT1.y, r5, c[c_cubematrix_1]
  120. dp3 oT1.z, r5, c[c_cubematrix_2]
  121.  
  122. ; f_calculate_objectspace_directionallight_diffuse_intensity
  123. dp3 r5, r4, c[c_dirlight_direction_0]
  124.  
  125. ; f_clamp_diffuse_exponentiate_specular
  126. lit r5, r5
  127.  
  128. ; f_dirlight_accumulate_diffuse
  129. mad r5, r5.yyyy, c[c_dirlight_diffuse_0], r1
  130.  
  131. ; f_calculate_objectspace_directionallight_diffuse_intensity
  132. dp3 r1, r4, c[c_dirlight_direction_1]
  133.  
  134. ; f_clamp_diffuse_exponentiate_specular
  135. lit r1, r1
  136.  
  137. ; f_dirlight_accumulate_diffuse
  138. mad r1, r1.yyyy, c[c_dirlight_diffuse_1], r5
  139.  
  140. ; f_calculate_objectspace_pointlight_vector
  141. add r5, c[c_pointlight_position_0], -r0
  142. dp3 r5.w, r5, r5
  143. rsq r5.w, r5.wwww
  144. mul r5, r5, r5.wwww
  145.  
  146. ; f_calculate_objectspace_pointlight_diffuse_intensity
  147. dp3 r5, r4, r5
  148.  
  149. ; f_clamp_diffuse_exponentiate_specular
  150. lit r5, r5
  151.  
  152. ; f_pointlight_accumulate_diffuse
  153. mad r5, r5.yyyy, c[c_pointlight_diffuse_0], r1
  154.  
  155. ; f_calculate_objectspace_pointlight_vector
  156. add r0, c[c_pointlight_position_1], -r0
  157. dp3 r0.w, r0, r0
  158. rsq r0.w, r0.wwww
  159. mul r0, r0, r0.wwww
  160.  
  161. ; f_calculate_objectspace_pointlight_diffuse_intensity
  162. dp3 r4, r4, r0
  163.  
  164. ; f_clamp_diffuse_exponentiate_specular
  165. lit r4, r4
  166.  
  167. ; f_pointlight_accumulate_diffuse
  168. mad r4, r4.yyyy, c[c_pointlight_diffuse_1], r5
  169.  
  170. ; f_write_default_texture
  171.  
  172. ; f_set_diffuse_alpha_ambient
  173. mov oD0.w, c[c_ambient_light].wwww
  174.  
  175. ; f_write_diffuse_result
  176. mov oD0.xyz, r4
  177.  
  178. ; end
  179.