mlpcardgame/Scenes/Board/UI/PhaseColor.shader

19 lines
459 B
Text
Raw Normal View History

shader_type canvas_item;
render_mode unshaded;
uniform vec4 fillColor: hint_color;
uniform vec4 baseColor: hint_color;
uniform float fillRatio: hint_range(0.0, 1.0);
uniform float fillAngle: hint_range(0.0, 6.28);
void fragment() {
vec4 col = texture(TEXTURE, UV);
vec3 mask = col.xyz * -1.0 + 1.0;
if (UV.y+fillAngle*UV.x > (1.0 - fillRatio)*1.2) {
mask *= fillColor.xyz;
col.xyz += mask.xyz;
} else {
col.xyz += baseColor.xyz;
}
COLOR = col;
}