mirror of
https://github.com/ScrelliCopter/NeHe-SDL_GPU.git
synced 2025-06-19 21:49:17 +10:00
shaders: Implement HLSL for lessons 2-8
This commit is contained in:
31
src/shaders/lesson2.hlsl
Normal file
31
src/shaders/lesson2.hlsl
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: (C) 2025 a dinosaur
|
||||
* SPDX-License-Identifier: Zlib
|
||||
*/
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
float3 position : TEXCOORD0;
|
||||
};
|
||||
|
||||
cbuffer VertexUniform : register(b0, space1)
|
||||
{
|
||||
float4x4 viewproj : packoffset(c0);
|
||||
};
|
||||
|
||||
struct Vertex2Pixel
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
};
|
||||
|
||||
Vertex2Pixel VertexMain(VertexInput input)
|
||||
{
|
||||
Vertex2Pixel output;
|
||||
output.position = mul(viewproj, float4(input.position, 1.0));
|
||||
return output;
|
||||
}
|
||||
|
||||
half4 PixelMain(Vertex2Pixel input) : SV_Target0
|
||||
{
|
||||
return half4(1.0, 1.0, 1.0, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user