Advertisement
Guest User

Untitled

a guest
Sep 24th, 2020
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. shader_type canvas_item;
  2.  
  3. uniform vec4 base_color: hint_color = vec4(0.0, 0.0, 0.0, 1.0);
  4.  
  5. void fragment(){
  6. COLOR = texture(TEXTURE, UV); //read from texture
  7.  
  8. if (COLOR.a > 0.5) {
  9.  
  10. float result = mod(UV.x * UV.y * 4.0, 0.2);
  11.  
  12. if ((result > 0.00 && result < 0.01) || result > 0.95) {
  13. // Red
  14. COLOR.r = 0.71764;
  15. COLOR.g = 0.31764;
  16. COLOR.b = 0.298039;
  17. } else if (result > 0.03 && result < 0.06) {
  18. // Green
  19. COLOR.r = 0.0666;
  20. COLOR.g = 0.6156;
  21. COLOR.b = 0.46666;
  22. } else {
  23. // Black
  24. COLOR.r = base_color.r;
  25. COLOR.g = base_color.g;
  26. COLOR.b = base_color.b;
  27. COLOR.a = base_color.a;
  28. }
  29. }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement