35 lines
758 B
HLSL
35 lines
758 B
HLSL
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;
|
|
} |