What am I Doing Wrong ? if I Compile This Get an Error
cbuffer MatrixBuffer
{
matrix worldM;
matrix viewM;
matrix projectionM;
};
struct VertexInput
{
float4 position : POSITION;
float4 color : COLOR;
};
struct PixelInput
{
float4 position : SV_POSITION;
float4 color : COLOR;
}
PixelInput ColorVertexShader(VertexInput input)
{
PixelInputType output;
input.position.w = 1.0f;
output.position = mul(input.position, worldM);
output.position = mul(output.position, viewM);
output.position = mul(output.position, projectionM);
output.color = input.color;
return output;
}
i get a syntax error at line 2 at the " { "
and if i do This
matrix worldM;
matrix viewM;
matrix projectionM;
struct VertexInput
{
float4 position : POSITION;
float4 color : COLOR;
};
struct PixelInput
{
float4 position : SV_POSITION;
float4 color : COLOR;
}
PixelInput ColorVertexShader(VertexInput input)
{
PixelInputType output;
input.position.w = 1.0f;
output.position = mul(input.position, worldM);
output.position = mul(output.position, viewM);
output.position = mul(output.position, projectionM);
output.color = input.color;
return output;
}
i get an unexpected token 'output '
I Got No Idea What Wrong Im Still a Noob in Writing Shaders in HLSL