Skip to content

Commit

Permalink
Fix casing of border_radius in quad shader
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Nov 8, 2022
1 parent 27a90e7 commit 3875a46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions glow/src/shader/core/quad.frag
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ void main() {

vec2 fragCoord = vec2(gl_FragCoord.x, u_ScreenHeight - gl_FragCoord.y);

float borderRadius = selectBorderRadius(
float border_radius = selectBorderRadius(
v_BorderRadius,
fragCoord,
(v_Pos + v_Scale * 0.5).xy
);

// TODO: Remove branching (?)
if(v_BorderWidth > 0.0) {
float internal_border = max(borderRadius - v_BorderWidth, 0.0);
float internal_border = max(border_radius - v_BorderWidth, 0.0);

float internal_distance = fDistance(
fragCoord,
Expand All @@ -85,11 +85,11 @@ void main() {
fragCoord,
v_Pos,
v_Scale,
borderRadius
border_radius
);

float radius_alpha =
1.0 - smoothstep(max(borderRadius - 0.5, 0.0), borderRadius + 0.5, d);
1.0 - smoothstep(max(border_radius - 0.5, 0.0), border_radius + 0.5, d);

gl_FragColor = vec4(mixed_color.xyz, mixed_color.w * radius_alpha);
}

0 comments on commit 3875a46

Please sign in to comment.