Passing colors through a pixel shader in HLSL
问题 I have have a pixel shader that should simply pass the input color through, but instead I am getting a constant result. I think my syntax might be the problem. Here is the shader: struct PixelShaderInput { float3 color : COLOR; }; struct PixelShaderOutput { float4 color : SV_TARGET0; }; PixelShaderOutput main(PixelShaderInput input) { PixelShaderOutput output; output.color.rgba = float4(input.color, 1.0f); // input.color is 0.5, 0.5, 0.5; output is black // output.color.rgba = float4(0.5f, 0