Initial Commit
This commit is contained in:
commit
5314a9d5c5
308 changed files with 190647 additions and 0 deletions
20
vendor/SDL3_ttf-3.2.2/examples/testgputext/shaders/shader-sdf.frag.hlsl
vendored
Normal file
20
vendor/SDL3_ttf-3.2.2/examples/testgputext/shaders/shader-sdf.frag.hlsl
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
Texture2D<float4> tex : register(t0, space2);
|
||||
SamplerState samp : register(s0, space2);
|
||||
|
||||
struct PSInput {
|
||||
float4 color : TEXCOORD0;
|
||||
float2 tex_coord : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct PSOutput {
|
||||
float4 color : SV_Target;
|
||||
};
|
||||
|
||||
PSOutput main(PSInput input) {
|
||||
PSOutput output;
|
||||
const float smoothing = (1.0 / 16.0);
|
||||
float distance = tex.Sample(samp, input.tex_coord).a;
|
||||
float alpha = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance);
|
||||
output.color = float4(input.color.rgb, input.color.a * alpha);
|
||||
return output;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue