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.

52 lines
1.3 KiB

  1. vs.1.1
  2. # DYNAMIC: "DOWATERFOG" "0..1"
  3. #include "macros.vsh"
  4. local( $worldPos, $worldNormal, $projPos, $reflectionVector );
  5. &AllocateRegister( \$projPos );
  6. dp4 $projPos.x, $vPos, $cModelViewProj0
  7. dp4 $projPos.y, $vPos, $cModelViewProj1
  8. dp4 $projPos.z, $vPos, $cModelViewProj2
  9. dp4 $projPos.w, $vPos, $cModelViewProj3
  10. mov oPos, $projPos
  11. &AllocateRegister( \$worldPos );
  12. ; garymcthack
  13. dp4 $worldPos.z, $vPos, $cModel2
  14. &CalcFog( $worldPos, $projPos );
  15. &FreeRegister( \$worldPos );
  16. &FreeRegister( \$projPos );
  17. ;------------------------------------------------------------------------------
  18. ; Texture coordinates
  19. ;------------------------------------------------------------------------------
  20. ; base texcoords
  21. dp4 oT0.x, $vTexCoord0, $SHADER_SPECIFIC_CONST_0
  22. dp4 oT0.y, $vTexCoord0, $SHADER_SPECIFIC_CONST_1
  23. dp4 oT1.x, $vTexCoord0, $SHADER_SPECIFIC_CONST_2
  24. dp4 oT1.y, $vTexCoord0, $SHADER_SPECIFIC_CONST_3
  25. ; lightmap texcoords
  26. mov oT2, $vTexCoord1
  27. ; detail
  28. dp4 oT3.x, $vTexCoord0, $SHADER_SPECIFIC_CONST_4
  29. dp4 oT3.y, $vTexCoord0, $SHADER_SPECIFIC_CONST_5
  30. ; mask
  31. dp4 oT4.x, $vTexCoord0, $SHADER_SPECIFIC_CONST_6
  32. dp4 oT4.y, $vTexCoord0, $SHADER_SPECIFIC_CONST_7
  33. ; Now the basetexture/basetexture2 blend uses vertex color, so send it into the psh.
  34. mov oD0, $vColor
  35. &FreeRegister( \$worldPos ); # garymcthack