2015-01-26 22:16:42 +03:00
|
|
|
#if !defined(FLAGS_ADDED)
|
|
|
|
# error FLAGS_ADDED not defined
|
|
|
|
#endif
|
|
|
|
|
2014-08-28 17:53:24 +04:00
|
|
|
cbuffer ModelViewProjectionConstantBuffer : register(b0)
|
|
|
|
{
|
|
|
|
matrix model;
|
|
|
|
matrix view;
|
|
|
|
matrix projection;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VertexShaderInput
|
|
|
|
{
|
|
|
|
float3 pos : POSITION;
|
|
|
|
float3 color : COLOR0;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VertexShaderOutput
|
|
|
|
{
|
|
|
|
float4 pos : SV_POSITION;
|
|
|
|
float3 color : COLOR0;
|
|
|
|
};
|
|
|
|
|
2014-12-02 12:41:10 +03:00
|
|
|
VertexShaderOutput mainVS(VertexShaderInput input)
|
2014-08-28 17:53:24 +04:00
|
|
|
{
|
|
|
|
VertexShaderOutput output;
|
|
|
|
float4 pos = float4(input.pos, 1.0f);
|
|
|
|
|
|
|
|
// Transform the vertex position into projected space.
|
|
|
|
pos = mul(pos, model);
|
|
|
|
pos = mul(pos, view);
|
|
|
|
pos = mul(pos, projection);
|
|
|
|
output.pos = pos;
|
|
|
|
|
|
|
|
// Pass through the color without modification.
|
|
|
|
output.color = input.color;
|
|
|
|
|
|
|
|
return output;
|
|
|
|
}
|