Unify circular corner geometry and shader masks
This commit is contained in:
1 parent
0162870cca
commit
f110ec80e1
19 files changed
+277
-135
No files matched your search
@@ -19,11 +19,11 @@ uniform float presentation_alpha;
|
||||
uniform float background_opacity;
|
||||
uniform vec4 tint;
|
||||
varying vec2 v_coords;
|
||||
//_CORNERS_
|
||||
|
||||
void main() {
|
||||
vec2 half_size = visible_rect.zw * 0.5;
|
||||
vec2 d = abs(gl_FragCoord.xy - visible_rect.xy - half_size) - (half_size - vec2(material_radius));
|
||||
float sdf = length(max(d, 0.0)) + min(max(d.x, d.y), 0.0) - material_radius;
|
||||
float coverage = alpha * presentation_alpha * (1.0 - smoothstep(-0.5, 0.5, sdf));
|
||||
float sdf = rounded_rect_distance(gl_FragCoord.xy, visible_rect, material_radius);
|
||||
float coverage = alpha * presentation_alpha * edge_coverage(sdf);
|
||||
if (coverage <= 0.0) { gl_FragColor = vec4(0.0); return; }
|
||||
vec2 coords = (gl_FragCoord.xy - capture_origin) / texture_size;
|
||||
vec4 color = vec4(0.0);
|
||||
|
||||
Reference in new issue
Block a user