Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.4 KiB

  1. vs.1.1
  2. # DYNAMIC: "DOWATERFOG" "0..1"
  3. ;------------------------------------------------------------------------------
  4. ; Constants specified by the app
  5. ; c0 = (0, 1, 2, 0.5)
  6. ; c1 = (1/2.2, 0, 0, 0)
  7. ; c2 = camera position *in world space*
  8. ; c4-c7 = modelViewProj matrix (transpose)
  9. ; c8-c11 = ViewProj matrix (transpose)
  10. ; c12-c15 = model->view matrix (transpose)
  11. ; c16 = [fogStart, fogEnd, fogRange, undefined]
  12. ;
  13. ; Vertex components (as specified in the vertex DECL)
  14. ; $vPos = Position
  15. ; $vTexCoord0.xy = TexCoord0
  16. ;------------------------------------------------------------------------------
  17. #include "macros.vsh"
  18. ; Vertex components
  19. ; $vPos = Position
  20. ; $vNormal = normal
  21. ; $vTexCoord0.xy = TexCoord0
  22. ; $vTangentS = S axis of Texture space
  23. ; $vTangentT = T axis of Texture space
  24. ;------------------------------------------------------------------------------
  25. ; Transform the position from world to view space
  26. ;------------------------------------------------------------------------------
  27. alloc $worldPos
  28. alloc $projPos
  29. ; Transform position from world to projection space
  30. dp4 $projPos.x, $vPos, $cViewProj0
  31. dp4 $projPos.y, $vPos, $cViewProj1
  32. dp4 $projPos.z, $vPos, $cViewProj2
  33. dp4 $projPos.w, $vPos, $cViewProj3
  34. mov oPos, $projPos
  35. dp4 $worldPos.z, $vPos, $cModel2
  36. &CalcFog( $worldPos, $projPos );
  37. free $projPos
  38. free $worldPos
  39. mov oD0, $vColor
  40. mov oT0, $vTexCoord0
  41. mov oT1, $vTexCoord1
  42. mov oT2, $vTexCoord2