SpecularColor.hx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package hrt.shader;
  2. class SpecularColorAlbedo extends hxsl.Shader {
  3. static var SRC = {
  4. var albedoGamma : Vec3;
  5. var customSpecularColor : Vec3;
  6. function fragment() {
  7. customSpecularColor = albedoGamma;
  8. }
  9. }
  10. }
  11. class SpecularColorFlat extends hxsl.Shader {
  12. static var SRC = {
  13. @param var specularColorValue : Vec3;
  14. var customSpecularColor : Vec3;
  15. function fragment() {
  16. customSpecularColor = specularColorValue;
  17. }
  18. }
  19. }
  20. class SpecularColorTexture extends hxsl.Shader {
  21. static var SRC = {
  22. @param var specularColorTexture : Sampler2D;
  23. var customSpecularColor : Vec3;
  24. var calculatedUV : Vec2;
  25. function fragment() {
  26. customSpecularColor = specularColorTexture.get(calculatedUV % 1.0).rgb;
  27. }
  28. }
  29. }
  30. class SpecularColor extends hxsl.Shader {
  31. static var SRC = {
  32. @param var specular : Float;
  33. @param var specularTint : Float;
  34. var customSpecularColor : Vec3;
  35. var pbrSpecularColor : Vec3;
  36. function fragment() {
  37. pbrSpecularColor = mix(vec3(1.0), customSpecularColor, specularTint) * vec3(specular * 0.08);
  38. }
  39. }
  40. }