A game created for the Godot Wild Jam #21
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
561B

  1. shader_type canvas_item;
  2. uniform vec4 primary_color:hint_color = vec4(1.0, 0.8, 0.0, 1.0);
  3. uniform float fade_offset:hint_range(0.0, 0.5) = 0.1;
  4. float ramp(float v, float f_min, float f_max){
  5. float res = (v - f_min) / (f_max - f_min);
  6. return max(0.0, min(res, 1.0));
  7. }
  8. void fragment(){
  9. float mask = length(vec2(0.5, 0.5) - (UV.xy));
  10. float fade = 1.0 - ramp(mask, fade_offset, 0.5);
  11. if (mask > 0.5){
  12. mask = 0.0;
  13. } else {mask = 1.0;}
  14. if (mask == 1.0){
  15. COLOR = vec4(primary_color.rgb, fade);
  16. } else {
  17. COLOR = vec4(primary_color.rgb, mask);
  18. }
  19. }