15 lines
344 B
Plaintext
15 lines
344 B
Plaintext
#include "fgui_text_shared.slang"
|
|
|
|
[shader("fragment")]
|
|
float4 _main(
|
|
VertexOutput input,
|
|
uint triid: SV_PrimitiveID,
|
|
) : SV_TARGET
|
|
{
|
|
float dist = SampleTexture(font, (input.uv+glyphPos)*glyphSize).x;
|
|
float smoothing = 0.4;
|
|
float alpha = clamp(smoothstep(0.5-smoothing, 0.5+smoothing, dist),0,1);
|
|
return float4(fontColor.xyz, alpha);
|
|
}
|
|
|