home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 January / Gamestar_80_2006-01_dvd.iso / Dema / splatmagazinerenegadepaintball_demo.exe / VShader072-000067110223.vsh < prev    next >
Text File  |  2005-10-13  |  4KB  |  142 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: 50
  7. ; Instructions removed by optimizer: 2
  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.0
  34.  
  35. ; f_decompress_position
  36. mad r0.xy, v0.ywww, c[c_constants].wwww, v0.xzzz
  37. mad r0.zw, v1.yyyy, c[c_constants].wwww, v1.xxxx
  38. mad r0.xyz, r0.xyzz, c[c_decompress_object_scale].xxxx, -c[c_decompress_object_scale].yyyy
  39. mov r0.w, c[c_constants].yyyy
  40.  
  41. ; f_decompress_normal
  42. mad r1, v3, c[c_constants].zzzz, -c[c_constants].yyyy
  43.  
  44. ; f_decompress_texture0
  45. mad r2.xy, v2.ywww, c[c_constants].wwww, v2.xzzz
  46. mad oT0.xy, r2.xyyy, c[c_decompress_object_scale].zzzz, -c[c_decompress_object_scale].wwww
  47.  
  48. ; f_move_fixed_localposition
  49. mov r0, r0
  50.  
  51. ; f_move_fixed_localnormal
  52.  
  53. ; f_outputobjectpos_clipspace
  54. mov r0.w, c[c_constants].yyyy
  55. dp4 oPos.x, r0, c[c_worldviewprojection_0]
  56. dp4 oPos.y, r0, c[c_worldviewprojection_1]
  57. dp4 oPos.z, r0, c[c_worldviewprojection_2]
  58. dp4 oPos.w, r0, c[c_worldviewprojection_3]
  59.  
  60. ; f_set_ambient
  61. mov r3, c[c_ambient_light]
  62.  
  63. ; f_create_objectspace_eyevector_local_viewer
  64. add r4, r0, -c[c_objectspace_eyeposition]
  65. dp3 r4.w, r4, r4
  66. rsq r5.w, r4.wwww
  67. mul r4, -r4, r5.wwww
  68.  
  69. ; f_calculate_linear_range_fog
  70. rcp r5.w, r5.wwww
  71. add r5.x, c[c_fogconst].yyyy, -r5.wwww
  72. mul r5.x, r5.xxxx, c[c_fogconst].zzzz
  73. add oFog, r5.xxxx, -c[c_fogconst].xxxx
  74.  
  75. ; f_calculate_objectspace_reflection
  76. dp3 r5.xyz, r4.xyzz, r1.xyzz
  77. add r5.xyz, -r5.xyzz, -r5.xyzz
  78. mad r5.xyz, r1.xyzz, -r5.xyzz, -r4.xyzz
  79.  
  80. ; f_calculate_cubereflection_vector_t1
  81. dp3 oT1.x, r5, c[c_cubematrix_0]
  82. dp3 oT1.y, r5, c[c_cubematrix_1]
  83. dp3 oT1.z, r5, c[c_cubematrix_2]
  84.  
  85. ; f_calculate_objectspace_directionallight_diffuse_intensity
  86. dp3 r5, r1, c[c_dirlight_direction_0]
  87.  
  88. ; f_clamp_diffuse_exponentiate_specular
  89. lit r5, r5
  90.  
  91. ; f_dirlight_accumulate_diffuse
  92. mad r5, r5.yyyy, c[c_dirlight_diffuse_0], r3
  93.  
  94. ; f_calculate_objectspace_directionallight_diffuse_intensity
  95. dp3 r3, r1, c[c_dirlight_direction_1]
  96.  
  97. ; f_clamp_diffuse_exponentiate_specular
  98. lit r3, r3
  99.  
  100. ; f_dirlight_accumulate_diffuse
  101. mad r3, r3.yyyy, c[c_dirlight_diffuse_1], r5
  102.  
  103. ; f_calculate_objectspace_pointlight_vector
  104. add r5, c[c_pointlight_position_0], -r0
  105. dp3 r5.w, r5, r5
  106. rsq r5.w, r5.wwww
  107. mul r5, r5, r5.wwww
  108.  
  109. ; f_calculate_objectspace_pointlight_diffuse_intensity
  110. dp3 r5, r1, r5
  111.  
  112. ; f_clamp_diffuse_exponentiate_specular
  113. lit r5, r5
  114.  
  115. ; f_pointlight_accumulate_diffuse
  116. mad r5, r5.yyyy, c[c_pointlight_diffuse_0], r3
  117.  
  118. ; f_calculate_objectspace_pointlight_vector
  119. add r0, c[c_pointlight_position_1], -r0
  120. dp3 r0.w, r0, r0
  121. rsq r0.w, r0.wwww
  122. mul r0, r0, r0.wwww
  123.  
  124. ; f_calculate_objectspace_pointlight_diffuse_intensity
  125. dp3 r1, r1, r0
  126.  
  127. ; f_clamp_diffuse_exponentiate_specular
  128. lit r1, r1
  129.  
  130. ; f_pointlight_accumulate_diffuse
  131. mad r1, r1.yyyy, c[c_pointlight_diffuse_1], r5
  132.  
  133. ; f_write_default_texture
  134.  
  135. ; f_set_diffuse_alpha_ambient
  136. mov oD0.w, c[c_ambient_light].wwww
  137.  
  138. ; f_write_diffuse_result
  139. mov oD0.xyz, r1
  140.  
  141. ; end
  142.