Added: world, view & projection matrices Added: delta time calculation Added: quad mesh
33 lines
702 B
HLSL
33 lines
702 B
HLSL
// semantics: https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-semantics
|
|
|
|
cbuffer MatrixBuffer
|
|
{
|
|
float4x4 WorldViewProjectionMatrix;
|
|
float4x4 WorldMatrix;
|
|
};
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 position : POSITION;
|
|
float4 color : COLOR;
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 position : SV_Position;
|
|
float4 color : COLOR;
|
|
};
|
|
|
|
VertexOutput main(VertexInput INPUT)
|
|
{
|
|
// mul -> matrix multiplication
|
|
// * -> number/scalar calculation
|
|
//return mul(INPUT.position, WorldViewProjectionMatrix);
|
|
|
|
VertexOutput OUTPUT;
|
|
|
|
OUTPUT.position = mul(INPUT.position, WorldViewProjectionMatrix);
|
|
OUTPUT.color = INPUT.color;
|
|
|
|
return OUTPUT;
|
|
} |