diff options
| author | Vasco <[email protected]> | 2026-08-24 03:53:16 +0100 |
|---|---|---|
| committer | Vasco <[email protected]> | 2026-08-24 03:53:16 +0100 |
| commit | ad5248a3e1bafc1b7dec4c8af82d56ed324ef314 (patch) | |
| tree | b575c3b85d6ad314fa9768855bed9aed8642917e /demos/teapot/shaders/basic.slang | |
| parent | 5dc2716abd43166cd65133625f408ad36a6623b3 (diff) | |
Slimed out podium. Updated math. Rend kinda works but still bugged.
Diffstat (limited to 'demos/teapot/shaders/basic.slang')
| -rw-r--r-- | demos/teapot/shaders/basic.slang | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/demos/teapot/shaders/basic.slang b/demos/teapot/shaders/basic.slang new file mode 100644 index 0000000..cfbf48a --- /dev/null +++ b/demos/teapot/shaders/basic.slang @@ -0,0 +1,36 @@ +struct VSInput { + [[vk::location(0)]] float3 inPosition : POSITION; + [[vk::location(1)]] float2 uv : TEXCOORD0; +}; + +struct VSOutput { + float4 pos : SV_Position; + float3 color; + float2 uv; +}; + +struct PushConstants { + float4x4 ubo; +}; + +[[vk::binding(0, 0)]] ConstantBuffer<float4x4> ubos[3]; +[[vk::binding(1, 0)]] Sampler2D test[3]; + +[[vk::push_constant]] +PushConstants pc; + +[shader("vertex")] +VSOutput vertMain(VSInput input) { + VSOutput output; + + output.pos = mul(pc.ubo, float4(input.inPosition, 1.0)); + output.color = input.inPosition; + output.uv = input.uv; + return output; +} + +[shader("fragment")] +float4 fragMain(VSOutput vertIn) : SV_TARGET { + float4 col = test[0].Sample(vertIn.uv); + return float4(col.rgb, 1.0); +} |
