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.

34 lines
767 B

  1. ps.1.1
  2. def c0, 1,0,0,0
  3. def c1, 0,1,0,0
  4. def c2, 0,0,1,0
  5. ;------------------------------------------------------------------------------
  6. ; Computes the diffuse component of lighting using lightmap + bumpmap
  7. ; t0 - Normalmap
  8. ; t1 - Lightmap1
  9. ; t2 - Lightmap2
  10. ; t3 - Lightmap3
  11. ;
  12. ; The texture coordinates need to be defined as follows:
  13. ; tc0 - Normalmap and lightmap texture coordinates
  14. ;------------------------------------------------------------------------------
  15. ; Get the 3-vector from the normal map
  16. tex t0
  17. ; Sample the lightmaps
  18. tex t1
  19. tex t2
  20. tex t3
  21. ; output = lightmapColor[0] * n.r + lightmapColor[1] * n.g + lightmapColor[2] * n.b
  22. mov r0, t0
  23. dp3 r1, t0, c0
  24. mul r0.rgb, r1, t1
  25. dp3 r1, t0, c1
  26. mad r0.rgb, r1, t2, r0
  27. dp3 r1, t0, c2
  28. mad r0.rgb, r1, t3, r0