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