I have this following struct which I use to describe vertexes to input assembler stage:
struct Vertex3D
{
XMFLOAT3 Position; // position x, y, z
XMFLOAT4 Color; // color r, g, b, a
};
I know I could use
{"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0}
To describe this structure if my position was of type XMFLOAT2
.
Now I want to extend my struct into 3D space and I have tried to set the desriptor as follows:
{"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0}
and my vertex shader is as follows (probably the simplest one possible)
void VertexShaderFunction( in float4 posIn : POSITION, in float4 colorIn : COLOR, out float4 posOut : SV_POSITION, out float4 colorOut : COLOUR ){
posOut = posIn;
colorOut = colorIn;
}
But changing the z coordinate in position doesn't seem to have any effect in the rendering of vertexes. So what would be the correct descriptor to bind into input assembler stage vertex buffer?