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.

45 lines
1.2 KiB

  1. vs.1.1
  2. # DYNAMIC: "DOWATERFOG" "0..1"
  3. #include "macros.vsh"
  4. ;------------------------------------------------------------------------------
  5. ; $SHADER_SPECIFIC_CONST_0-$SHADER_SPECIFIC_CONST_1 = Base texture transform
  6. ; $SHADER_SPECIFIC_CONST_2-$SHADER_SPECIFIC_CONST_3 = Mask texture transform
  7. ; $SHADER_SPECIFIC_CONST_4 = Modulation color
  8. ;------------------------------------------------------------------------------
  9. &AllocateRegister( \$projPos );
  10. ; Transform position from object to projection space
  11. dp4 $projPos.x, $vPos, $cModelViewProj0
  12. dp4 $projPos.y, $vPos, $cModelViewProj1
  13. dp4 $projPos.z, $vPos, $cModelViewProj2
  14. dp4 $projPos.w, $vPos, $cModelViewProj3
  15. mov oPos, $projPos
  16. ;------------------------------------------------------------------------------
  17. ; Fog
  18. ;------------------------------------------------------------------------------
  19. alloc $worldPos
  20. if( $DOWATERFOG == 1 )
  21. {
  22. ; Get the worldpos z component only since that's all we need for height fog
  23. dp4 $worldPos.z, $vPos, $cModel2
  24. }
  25. &CalcFog( $worldPos, $projPos );
  26. free $worldPos
  27. &FreeRegister( \$projPos );
  28. ; YUCK! This is to make texcoords continuous for mat_softwaretl
  29. mov oT0, $cZero
  30. ; Texture coordinates
  31. mov oT1, $vTexCoord1
  32. mov oD0, $cOne