This commit is contained in:
2026-02-08 23:00:31 +01:00
parent fceac125c5
commit 554da7d0ec
10 changed files with 479 additions and 122 deletions

View File

@@ -30,9 +30,9 @@ void main() {
float interior_corner_radius = frag_border_radius * interior_radius_reduce_f * interior_radius_reduce_f;
float inside_d = roundedRectSDF(
frag_dest_position,
frag_dest_center,
interior_half_size - softness_padding,
frag_dest_position,
frag_dest_center,
interior_half_size - softness_padding,
interior_corner_radius);
@@ -41,15 +41,15 @@ void main() {
}
float dist = roundedRectSDF(
frag_dest_position,
frag_dest_center,
frag_dest_half_size - softness_padding,
frag_dest_position,
frag_dest_center,
frag_dest_half_size - softness_padding,
frag_border_radius);
// For texturing later
float sample = 1;
float sdf_factor = 1.0f - smoothstep(0, 2*frag_softness, dist);
float sdf_factor = 1 - smoothstep(0, 2*frag_softness, dist);
pixel_color = frag_color * sample * sdf_factor * border_factor;
};