Add slang shaders for additional samples

This commit is contained in:
Sascha Willems 2025-05-04 17:23:23 +02:00
parent b3c032ef68
commit 7c115af4a3
8 changed files with 529 additions and 0 deletions

View file

@ -0,0 +1,37 @@
/* Copyright (c) 2025, Sascha Willems
*
* SPDX-License-Identifier: MIT
*
*/
struct VSInput
{
float2 Pos;
float2 UV;
float4 Color;
};
struct VSOutput
{
float4 Pos : SV_POSITION;
float2 UV;
float4 Color;
};
Sampler2D fontSampler;
[shader("vertex")]
VSOutput vertexMain(VSInput input, uniform float2 scale, uniform float2 translate)
{
VSOutput output;
output.UV = input.UV;
output.Color = input.Color;
output.Pos = float4(input.Pos * scale + translate, 0.0, 1.0);
return output;
}
[shader("fragment")]
float4 fragmentMain(VSOutput input)
{
return input.Color * fontSampler.Sample(input.UV);
}