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
977 B

  1. ; STATIC: "TRANSLUCENT" "0..1"
  2. ; STATIC: "UNLIT" "0..1"
  3. ps.1.1
  4. ;------------------------------------------------------------------------------
  5. ; Draw a texture . . woo hoo!
  6. ; t0 - texture
  7. ;
  8. ; The texture coordinates need to be defined as follows:
  9. ; tc0 - texcoords
  10. ;------------------------------------------------------------------------------
  11. ;------------------------------------------------------------------------------
  12. #if UNLIT==0
  13. tex t0
  14. tex t1
  15. mul_sat t1, c1, t1
  16. lrp r1.rgb, t1, c5, v0 ; blend between unlit and lit.
  17. mul r0, t0, c3
  18. mul r0.rgb, r1, r0 ; Apply lighting
  19. mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
  20. # if TRANSLUCENT==0
  21. mov r0.a, c4.a
  22. # endif
  23. #endif
  24. ;------------------------------------------------------------------------------
  25. #if UNLIT!=0
  26. ; Get the color from the texture
  27. tex t0
  28. mul r0, t0, c3
  29. mul r0.rgb, v0, r0 ; Apply lighting
  30. mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
  31. # if TRANSLUCENT==0
  32. mov r0.a, c4.a
  33. # endif
  34. #endif