@multiplekex/shallot 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/extras/text/index.ts +7 -2
package/package.json
CHANGED
package/src/extras/text/index.ts
CHANGED
|
@@ -520,13 +520,18 @@ fn fs(input: VertexOutput) -> FragmentOutput {
|
|
|
520
520
|
// Smoothstep with adaptive band
|
|
521
521
|
let alpha = smoothstep(aaDist, -aaDist, signedDist);
|
|
522
522
|
|
|
523
|
-
|
|
523
|
+
// Dilate mask by FXAA span (8 pixels) to prevent edge bleeding
|
|
524
|
+
let fxaaSpan = aaDist * 8.0;
|
|
525
|
+
let inMaskRegion = signedDist < fxaaSpan;
|
|
526
|
+
|
|
527
|
+
// Only discard if outside both visible region and mask region
|
|
528
|
+
if alpha < 0.01 && !inMaskRegion {
|
|
524
529
|
discard;
|
|
525
530
|
}
|
|
526
531
|
|
|
527
532
|
var out: FragmentOutput;
|
|
528
533
|
out.color = vec4(input.color.rgb, input.color.a * alpha);
|
|
529
|
-
out.mask = select(0.0, 1.0,
|
|
534
|
+
out.mask = select(0.0, 1.0, inMaskRegion);
|
|
530
535
|
return out;
|
|
531
536
|
}
|
|
532
537
|
`;
|