making text pretty
This commit is contained in:
@@ -20,8 +20,12 @@ float4 shadeVideo(ShaderContext context)
|
||||
bool insideTextRect = textUv.x >= 0.0 && textUv.x <= 1.0 && textUv.y >= 0.0 && textUv.y <= 1.0;
|
||||
|
||||
float mask = insideTextRect ? sampleTitleText(textUv) : 0.0;
|
||||
float fill = smoothstep(0.48, 0.54, mask);
|
||||
float outline = smoothstep(0.48 - outlineWidth, 0.54 - outlineWidth, mask);
|
||||
float edge = 0.5;
|
||||
float aa = max(fwidth(mask) * 1.5, 0.006);
|
||||
float outlineAmount = min(outlineWidth * 0.25, 0.24);
|
||||
float fill = smoothstep(edge - aa, edge + aa, mask);
|
||||
float outlineField = smoothstep(edge - outlineAmount - aa, edge - outlineAmount + aa, mask);
|
||||
float outline = saturate(outlineField - fill);
|
||||
float textAlpha = max(fill * fillColor.a, outline * outlineColor.a);
|
||||
if (textAlpha <= 0.0001)
|
||||
return context.sourceColor;
|
||||
|
||||
Reference in New Issue
Block a user