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.

54 lines
1.2 KiB

  1. vs.1.1
  2. # DYNAMIC: "DOWATERFOG" "0..1"
  3. #include "macros.vsh"
  4. local( $worldPos, $worldNormal, $projPos, $reflectionVector );
  5. alloc $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. alloc $worldPos
  12. alloc $worldNormal
  13. dp4 $worldPos.x, $vPos, $cModel0
  14. dp4 $worldPos.y, $vPos, $cModel1
  15. dp4 $worldPos.z, $vPos, $cModel2
  16. dp3 $worldNormal.x, $vNormal, $cModel0
  17. dp3 $worldNormal.y, $vNormal, $cModel1
  18. dp3 $worldNormal.z, $vNormal, $cModel2
  19. &CalcFog( $worldPos, $projPos );
  20. free $projPos
  21. ;------------------------------------------------------------------------------
  22. ; Texture coordinates
  23. ;------------------------------------------------------------------------------
  24. ; base texcoords
  25. alloc $texcoord
  26. mul $texcoord.xyz, $worldPos, $SHADER_SPECIFIC_CONST_0
  27. mov oT0.xy, $texcoord.zy;
  28. mov oT1.xy, $texcoord.xz;
  29. mov oT2.xy, $texcoord.xy;
  30. free $texcoord
  31. ; lightmap texcoords
  32. mov oT3, $vTexCoord1
  33. mul oD0.rgb, $worldNormal, $worldNormal
  34. ; Now the basetexture/basetexture2 blend uses vertex color, so send it into the psh.
  35. mov oD0.a, $vColor
  36. free $worldPos
  37. free $worldNormal