Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shader_type canvas_item;
- uniform vec4 base_color: hint_color = vec4(0.0, 0.0, 0.0, 1.0);
- void fragment(){
- COLOR = texture(TEXTURE, UV); //read from texture
- if (COLOR.a > 0.5) {
- float result = mod(UV.x * UV.y * 4.0, 0.2);
- if ((result > 0.00 && result < 0.01) || result > 0.95) {
- // Red
- COLOR.r = 0.71764;
- COLOR.g = 0.31764;
- COLOR.b = 0.298039;
- } else if (result > 0.03 && result < 0.06) {
- // Green
- COLOR.r = 0.0666;
- COLOR.g = 0.6156;
- COLOR.b = 0.46666;
- } else {
- // Black
- COLOR.r = base_color.r;
- COLOR.g = base_color.g;
- COLOR.b = base_color.b;
- COLOR.a = base_color.a;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement