This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
LEFTONE/core/loshader/hud_bar.fshader

22 lines
387 B
Plaintext
Raw Normal View History

in vec2 v_pos;
in vec2 v_size;
in vec2 v_aa;
in vec2 v_dp;
in vec4 v_color;
out vec4 o_color;
void main() {
vec2 dp = v_dp;
dp *= pow(length(dp), .1);
vec2 diff = abs(dp - v_pos);
float aa = uni.aa * 4.;
float a =
(1.-smoothstep(v_size.x-aa, v_size.x, diff.x)) *
(1.-smoothstep(v_size.y-aa, v_size.y, diff.y));
o_color = v_color;
o_color.a *= a;
}