Switched to shader for corner rounding
This commit is contained in:
@@ -27,15 +27,30 @@ pub mod frag_color {
|
||||
|
||||
layout (set = 0, binding = 0) uniform ColorBlock {
|
||||
uniform vec4 in_color;
|
||||
uniform vec2 corner_radius;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
out_color.r = corner_radius.r;
|
||||
out_color = in_color;
|
||||
|
||||
vec2 uv_circ = ((1. - corner_radius) - (abs(in_uv + vec2(-0.5)) * 2.))/corner_radius;
|
||||
float dist = length(uv_circ);
|
||||
|
||||
out_color.a = mix(out_color.a, 0.,
|
||||
float(dist > 1.)
|
||||
* float(uv_circ.x < 0.)
|
||||
* float(uv_circ.y < 0.));
|
||||
}
|
||||
",
|
||||
}
|
||||
}
|
||||
//layout (location = 1) in float corner_radius;
|
||||
//out_color = in_color;
|
||||
// Some equation that determines whether to keep the pixel
|
||||
// Use Lerp not if
|
||||
//out_color.a = 0;
|
||||
|
||||
pub mod frag_glyph {
|
||||
vulkano_shaders::shader! {
|
||||
|
||||
Reference in New Issue
Block a user