Guest User

Untitled

a guest
Jul 16th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. // ------------------------------------------------------------------------
  2. // PLAYER COLOR CUSTOMIZATION
  3. // ------------------------------------------------------------------------
  4.  
  5. // The following chain of proxies is to modulate phong tint (and rimlight,
  6. // by extension) according to your chosen player color, but only within a
  7. // certain saturation range: 50%. This might be confusing, I tried my best
  8. // to comment it, e-mail [email protected] if you have any
  9. // questions regarding how player colourability is set up in VMTs. GLHF.
  10.  
  11. "$blendtintbybasealpha" "1" // alpha channel of $basetexture: color mask.
  12. "$blendtintcoloroverbase" "0" // blend mode. anything =/= 0 is ugly!
  13.  
  14. // --- Test values. Comment the PlayerColor proxy to use one of these.
  15. // "$color2" "{0 0 0}" // Black
  16. // "$color2" "{255 0 0}" //Blue (default)
  17. // "$color2" "{59 121 160}" // Blue (TF2)
  18. // "$color2" "{180 52 41}" // Red (TF2)
  19. // "$color2" "{100 72 58}" // Brown
  20. // "$color2" "{140 208 112}" // Green
  21. // "$color2" "{248 166 202}" // Pink
  22. // "$color2" "{160 100 140}" // Purple
  23. // "$color2" "{242 168 96}" // Yellow (gold-ish)
  24.  
  25. "$PhongBrightnessScalar" "0.5" // see below. "0.5" will get overwritten.
  26.  
  27. Proxies
  28. {
  29. PlayerColor
  30. {
  31. resultVar $color2 // pass the player color value to Gmod
  32. default 0.23 0.35 0.41 // unused for now.
  33. }
  34. Clamp // clamp the chosen color between 1% and 125% (usually)
  35. {
  36. min 0.01
  37. max 1.25
  38. srcVar1 "$color2"
  39. resultVar "$color2"
  40. }
  41. Clamp // copy this value to phong tint, clamp it to 50% min.
  42. {
  43. min 0.5
  44. max 1.0
  45. srcVar1 "$color2"
  46. resultVar "$phongtint"
  47. }
  48. Equals // copy $color2 value to exterior variable. this makes it
  49. { // no longer a RGB array but a single float instead (!??)
  50. srcVar1 "$color2"
  51. resultVar "$PhongBrightnessScalar"
  52. }
  53. Multiply // multiply $phongtint by this new float value.
  54. {
  55. srcVar1 "$phongtint"
  56. srcVar2 "$phongBrightnessScalar"
  57. resultVar "$phongtint"
  58. }
  59. Clamp // the result of this multiply doesn't go any lower than 20%
  60. {
  61. min 0.25
  62. max 1.00
  63. srcVar1 "$phongtint"
  64. resultVar "$phongtint"
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment