Add slang shaders for additional samples
This commit is contained in:
parent
b3c032ef68
commit
7c115af4a3
8 changed files with 529 additions and 0 deletions
37
shaders/slang/imgui/ui.slang
Normal file
37
shaders/slang/imgui/ui.slang
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue