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.

42 lines
1.1 KiB

  1. vs.1.1
  2. # DYNAMIC: "DOWATERFOG" "0..1"
  3. #include "macros.vsh"
  4. &AllocateRegister( \$projPos );
  5. dp4 $projPos.x, $vPos, $cViewProj0
  6. dp4 $projPos.y, $vPos, $cViewProj1
  7. dp4 $projPos.z, $vPos, $cViewProj2
  8. dp4 $projPos.w, $vPos, $cViewProj3
  9. mov oPos, $projPos
  10. ;------------------------------------------------------------------------------
  11. ; Fog
  12. ;------------------------------------------------------------------------------
  13. alloc $worldPos
  14. if( $DOWATERFOG == 1 )
  15. {
  16. ; Get the worldpos z component only since that's all we need for height fog
  17. dp4 $worldPos.z, $vPos, $cModel2
  18. }
  19. &CalcFog( $worldPos, $projPos );
  20. free $worldPos
  21. &FreeRegister( \$projPos );
  22. ; Shadow color
  23. mov oD0, $vColor
  24. ;------------------------------------------------------------------------------
  25. ; Texture coordinates
  26. ;------------------------------------------------------------------------------
  27. dp4 r0.x, $vTexCoord0, $SHADER_SPECIFIC_CONST_0
  28. dp4 r0.y, $vTexCoord0, $SHADER_SPECIFIC_CONST_1
  29. ; Jittered versions
  30. mov oT0, r0
  31. add oT1, r0, $SHADER_SPECIFIC_CONST_2
  32. sub oT2, r0, $SHADER_SPECIFIC_CONST_2
  33. add oT3, r0, $SHADER_SPECIFIC_CONST_3
  34. sub oT4, r0, $SHADER_SPECIFIC_CONST_3