Added: lighting

This commit is contained in:
2026-10-20 18:27:15 +02:00
parent 2246370722
commit e35a61c2a9
12 changed files with 179 additions and 15 deletions
@@ -0,0 +1,35 @@
cbuffer MatrixBuffer
{
float4x4 WorldViewProjectionMatrix;
float4x4 WorldMatrix;
};
struct VertexInput
{
float4 position : POSITION;
float2 uv : TEXCOORD;
float4 color : COLOR;
float3 normal : NORMAL;
};
struct VertexOutput
{
float4 position : SV_Position;
float3 positionWorld : POSITION1;
float2 uv : TEXCOORD;
float4 color : COLOR;
float3 normal : NORMAL;
};
VertexOutput main(VertexInput INPUT)
{
VertexOutput OUTPUT;
OUTPUT.position = mul(INPUT.position, WorldViewProjectionMatrix);
OUTPUT.positionWorld = mul(INPUT.position, WorldMatrix).xyz;
OUTPUT.normal = mul(INPUT.normal, (float3x3)WorldMatrix);
OUTPUT.uv = INPUT.uv;
OUTPUT.color = INPUT.color;
return OUTPUT;
}