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.

56 lines
1.9 KiB

  1. vs.1.1
  2. # DYNAMIC: "DOWATERFOG" "0..1"
  3. #include "macros.vsh"
  4. ;------------------------------------------------------------------------------
  5. ; Vertex blending
  6. ;------------------------------------------------------------------------------
  7. &AllocateRegister( \$worldPos );
  8. dp4 $worldPos.x, $vPos, $cModel0
  9. dp4 $worldPos.y, $vPos, $cModel1
  10. dp4 $worldPos.z, $vPos, $cModel2
  11. mov $worldPos.w, $cOne
  12. ;------------------------------------------------------------------------------
  13. ; Transform the position from world to proj space
  14. ;------------------------------------------------------------------------------
  15. &AllocateRegister( \$projPos );
  16. dp4 $projPos.x, $vPos, $cModelViewProj0
  17. dp4 $projPos.y, $vPos, $cModelViewProj1
  18. dp4 $projPos.z, $vPos, $cModelViewProj2
  19. dp4 $projPos.w, $vPos, $cModelViewProj3
  20. mov oPos, $projPos
  21. ;------------------------------------------------------------------------------
  22. ; Fog
  23. ;------------------------------------------------------------------------------
  24. &CalcFog( $worldPos, $projPos );
  25. &FreeRegister( \$worldPos );
  26. ;------------------------------------------------------------------------------
  27. ; Texture coordinates
  28. ;------------------------------------------------------------------------------
  29. mov oT0.xy, $vTexCoord0.xy
  30. ; special case perspective correct texture projection so that the texture fits exactly on the screen
  31. mul $projPos.y, $projPos.y, $SHADER_SPECIFIC_CONST_0.w
  32. add $projPos.xy, $projPos.xy, $projPos.w
  33. mul $projPos.xy, $projPos.xy, $cHalf
  34. mul $projPos.xy, $projPos.xy, $SHADER_SPECIFIC_CONST_0.xy
  35. mad $projPos.xy, $projPos.w, $SHADER_SPECIFIC_CONST_1.xy, $projPos.xy
  36. mov oT1.xy, $projPos.xy
  37. mov oT1.z, $projPos.w
  38. mov oT1.w, $projPos.w
  39. &FreeRegister( \$projPos );
  40. ;------------------------------------------------------------------------------
  41. ; Modulation color
  42. ;------------------------------------------------------------------------------
  43. mov oD0, $vColor