Apply HiDPI scaling to quads
The anti-aliasing strategy is pretty naive, but we will manage for now.
This commit is contained in:
parent
db716b3bdf
commit
5ff05b7f02
6 changed files with 61 additions and 32 deletions
|
|
@ -3,7 +3,7 @@
|
|||
layout(location = 0) in vec4 v_Color;
|
||||
layout(location = 1) in vec2 v_Pos;
|
||||
layout(location = 2) in vec2 v_Scale;
|
||||
layout(location = 3) in flat uint v_BorderRadius;
|
||||
layout(location = 3) in float v_BorderRadius;
|
||||
|
||||
layout(location = 0) out vec4 o_Color;
|
||||
|
||||
|
|
@ -27,11 +27,7 @@ float rounded(in vec2 frag_coord, in vec2 position, in vec2 size, float radius,
|
|||
}
|
||||
|
||||
void main() {
|
||||
float radius_alpha = 1.0;
|
||||
|
||||
if(v_BorderRadius > 0.0) {
|
||||
radius_alpha = rounded(gl_FragCoord.xy, v_Pos, v_Scale, v_BorderRadius, 0.5);
|
||||
}
|
||||
float radius_alpha = rounded(gl_FragCoord.xy, v_Pos, v_Scale, v_BorderRadius, 0.5);
|
||||
|
||||
o_Color = vec4(v_Color.xyz, v_Color.w * radius_alpha);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue