I tried changing "float4 Color: COLOR1" but didn't help because it's for Diffuse or specular color. I don't know what else to do, I don't know what to add.
I ran out of ideas.
HRESULT GenerateShader(ID3D11Device* pD3DDevice, ID3D11PixelShader**pShader, float r, float g, float b)
{
char szCast[] = "struct VS_OUT"
"{"
" float4 Position : SV_Position;"
" float4 Color : COLOR0;"
"};"
"float4 main( VS_OUT input ) : SV_Target"
"{"
" float4 fake;"
" fake.a = 0.5f;"
" fake.r = %0.2f;"
" fake.g = %0.2f;"
" fake.b = %0.2f;"
" return fake;"
"}";
ID3D10Blob* pBlob;
char szPixelShader[1000];
sprintf(szPixelShader, szCast, r, g, b);
ID3DBlob* d3dErrorMsgBlob;
HRESULT hr = D3DCompile(szPixelShader, sizeof(szPixelShader), "shader", NULL, NULL, "main", "ps_4_0", NULL, NULL, &pBlob, &d3dErrorMsgBlob);
if (FAILED(hr))
return hr;
hr = pD3DDevice->CreatePixelShader((DWORD*)pBlob->GetBufferPointer(), pBlob->GetBufferSize(), NULL, pShader);
if (FAILED(hr))
return hr;
return S_OK;
}