Add slang shaders for tessellation samples
This commit is contained in:
parent
c2e3b494da
commit
c58fd1844b
5 changed files with 639 additions and 0 deletions
42
shaders/slang/terraintessellation/skysphere.slang
Normal file
42
shaders/slang/terraintessellation/skysphere.slang
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* Copyright (c) 2025, Sascha Willems
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
struct VSInput
|
||||
{
|
||||
float3 Pos;
|
||||
float3 Normal;
|
||||
float2 UV;
|
||||
};
|
||||
|
||||
struct VSOutput
|
||||
{
|
||||
float4 Pos : SV_POSITION;
|
||||
float2 UV;
|
||||
};
|
||||
|
||||
struct UBO
|
||||
{
|
||||
float4x4 mvp;
|
||||
};
|
||||
ConstantBuffer<UBO> ubo;
|
||||
|
||||
Sampler2D samplerColorMap;
|
||||
|
||||
[shader("vertex")]
|
||||
VSOutput vertexMain(VSInput input)
|
||||
{
|
||||
VSOutput output;
|
||||
output.Pos = mul(ubo.mvp, float4(input.Pos, 1.0));
|
||||
output.UV = input.UV;
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
[shader("fragment")]
|
||||
float4 fragmentMain(VSOutput input)
|
||||
{
|
||||
return samplerColorMap.Sample(input.UV);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue