Camera-Renderer/Camera-Renderer_cpp/Content/SampleVertexShader.hlsl

34 lines
531 B
HLSL
Raw Normal View History

2021-10-05 00:17:24 +13:00
cbuffer ModelViewProjectionConstantBuffer : register(b0)
{
matrix model;
matrix view;
matrix projection;
};
struct VertexShaderInput
{
float3 pos : POSITION;
float3 color : COLOR0;
};
struct PixelShaderInput
{
float4 pos : SV_POSITION;
float3 color : COLOR0;
};
PixelShaderInput main(VertexShaderInput input)
{
PixelShaderInput output;
float4 pos = float4(input.pos, 1.0f);
pos = mul(pos, model);
pos = mul(pos, view);
pos = mul(pos, projection);
output.pos = pos;
output.color = input.color;
return output;
}