Advertisement
Guest User

Untitled

a guest
Aug 25th, 2024
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. shader_type canvas_item;
  2.  
  3. uniform vec4 target_color : source_color;
  4. uniform vec4 replace_color : source_color;
  5. uniform float tolerance : hint_range(0, 1);
  6.  
  7. void fragment() {
  8. vec4 tex_color = texture(TEXTURE, UV);
  9.  
  10. float dist = distance(tex_color.rgb, target_color.rgb);
  11.  
  12. if (dist < tolerance) {
  13. tex_color.rgb = replace_color.rgb;
  14. }
  15.  
  16. COLOR = tex_color;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement