My inputlayout (c++ side) looks like this:
layout[0].SemanticName = "POSITION";
layout[0].SemanticIndex = 0;
layout[0].Format = DXGI_FORMAT_R32G32B32_FLOAT;
layout[0].InputSlot = 0;
layout[0].AlignedByteOffset = 0;
layout[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
layout[0].InstanceDataStepRate = 0;
layout[1].SemanticName = "NORMAL";
layout[1].SemanticIndex = 0;
layout[1].Format = DXGI_FORMAT_R32G32B32_FLOAT;
layout[1].InputSlot = 0;
layout[1].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
layout[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
layout[1].InstanceDataStepRate = 0;
layout[2].SemanticName = "TEXCOORD";
layout[2].SemanticIndex = 0;
layout[2].Format = DXGI_FORMAT_R32G32_FLOAT;
layout[2].InputSlot = 0;
layout[2].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
layout[2].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
layout[2].InstanceDataStepRate = 0;
layout[3].SemanticName = "COLOR";
layout[3].SemanticIndex = 0;
layout[3].Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
layout[3].InputSlot = 0;
layout[3].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
layout[3].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
layout[3].InstanceDataStepRate = 0;
My shader takes this:
struct VertexInputType
{
float4 position : POSITION;
float3 normal : NORMAL;
float2 tex : TEXCOORD0;
float4 color : COLOR0;
};
Now, when I try to add another colorinput, COLOR1, nothing gets drawn by the shader. I noticed, that as soon as I change the inputlayout-semantic to TEXCOORD0 or COLOR0, nothing gets drawn either. What could cause this?
Ps: What does the SV_TARGET in "float4 TerrainPixelShader(PixelInputType input) : SV_TARGET {" ? I never got that.