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.

23 lines
356 B

  1. ps.1.1
  2. def c0, 0.00f, 0.00f, 0.00f, 0.25f
  3. def c1, 0.30f, 0.59f, 0.11f, 0.00f
  4. tex t0
  5. tex t1
  6. tex t2
  7. tex t3
  8. // r1 = average = ( t0 + t1 + t2 + t3 ) * 0.25
  9. mul r1.rgb, t0, c0.a
  10. mad r1.rgb, t1, c0.a, r1
  11. mad r1.rgb, t2, c0.a, r1
  12. mad r1.rgb, t3, c0.a, r1
  13. // r0.a = avg luminance
  14. dp3 r0, r1, c1
  15. // r0.rgb = color = average*(luminance)
  16. mul r0.rgb, r1, r0.a