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.

26 lines
721 B

  1. ps.1.1
  2. ; t0:
  3. ; texture: dudv map
  4. ; texcoords: dudvmap texcoords
  5. ; t1:
  6. ; texture: reflection render target
  7. ; texcoords:
  8. ; t2:
  9. ; texture: normal map (usef for fresnel calculation)
  10. ; texcoords:
  11. ; t4: texture: normalization cube map
  12. ; texcoords: eye vect
  13. tex t0 ; sample dudv map
  14. texbem t1, t0 ; reflection
  15. tex t2 ; normal map
  16. tex t3 ; eye vector (through normalization cubemap)
  17. ; dot eye-vector with per-pixel normal from t2
  18. dp3_sat r1.rgba, t3_bx2, t2_bx2
  19. ; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5
  20. mul r0.a, 1-r1.a, 1-r1.a // squared
  21. mul r0.a, r0.a, r0.a // quartic
  22. mul r0.rgb, t1, c0 // shove color from reflection render target into r0
  23. +mul_sat r0.a, r0.a, 1-r1.a // quintic