Added slang shaders for pipeline samples
This commit is contained in:
parent
b81e9d9654
commit
d8c8630654
4 changed files with 299 additions and 0 deletions
40
shaders/slang/pipelines/wireframe.slang
Normal file
40
shaders/slang/pipelines/wireframe.slang
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/* Copyright (c) 2025, Sascha Willems
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
struct VSInput
|
||||
{
|
||||
float4 Pos;
|
||||
float2 UV;
|
||||
float3 Color;
|
||||
};
|
||||
|
||||
struct VSOutput
|
||||
{
|
||||
float4 Pos : SV_POSITION;
|
||||
float3 Color;
|
||||
};
|
||||
|
||||
struct UBO
|
||||
{
|
||||
float4x4 projection;
|
||||
float4x4 model;
|
||||
};
|
||||
ConstantBuffer<UBO> ubo;
|
||||
|
||||
[shader("vertex")]
|
||||
VSOutput vertexMain(VSInput input)
|
||||
{
|
||||
VSOutput output;
|
||||
output.Color = input.Color;
|
||||
output.Pos = mul(ubo.projection, mul(ubo.model, input.Pos));
|
||||
return output;
|
||||
}
|
||||
|
||||
[shader("fragment")]
|
||||
float4 fragmentMain(VSOutput input)
|
||||
{
|
||||
return float4(input.Color * 1.5, 1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue