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