Font working
This commit is contained in:
@@ -15,11 +15,16 @@ float4 shadeVideo(ShaderContext context)
|
||||
float2 resolution = max(context.outputResolution, float2(1.0, 1.0));
|
||||
float aspect = resolution.x / resolution.y;
|
||||
float2 textSize = float2(0.72 * scale, 0.09 * scale * aspect);
|
||||
float2 textUv = (context.uv - position) / max(textSize, float2(0.0001, 0.0001));
|
||||
float2 safeTextSize = max(textSize, float2(0.0001, 0.0001));
|
||||
float2 textUv = (context.uv - position) / safeTextSize;
|
||||
bool insideTextRect = textUv.x >= 0.0 && textUv.x <= 1.0 && textUv.y >= 0.0 && textUv.y <= 1.0;
|
||||
|
||||
float mask = sampleTitleText(textUv);
|
||||
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 textAlpha = max(fill * fillColor.a, outline * outlineColor.a);
|
||||
if (textAlpha <= 0.0001)
|
||||
return context.sourceColor;
|
||||
|
||||
float4 base = context.sourceColor;
|
||||
float4 outlineLayer = float4(outlineColor.rgb * outlineColor.a, outline * outlineColor.a);
|
||||
|
||||
Reference in New Issue
Block a user