Pixel Shader Issues :

Posted by Morphex on Game Development See other posts from Game Development or by Morphex
Published on 2014-06-08T20:59:57Z Indexed on 2014/06/08 21:42 UTC
Read the original article Hit count: 186

Filed under:
|
|
|

I have issues with a pixel shader, my issue is mostly that I get nothing draw on the screen.

 float4x4 MVP;
 // TODO: add effect parameters here.
struct VertexShaderInput
{
float4 Position : POSITION;
float4 normal : NORMAL;
float2 TEXCOORD : TEXCOORD;

};
struct VertexShaderOutput
{
float4 Position : POSITION;

};
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
input.Position.w = 0;
VertexShaderOutput output;
output.Position = mul(input.Position, MVP);
// TODO: add your vertex shader code here.
return output;
}
float4 PixelShaderFunction(VertexShaderOutput input) : SV_TARGET
{

return float4(1, 0, 0, 1);
}
technique 
{
    pass 
    {
    Profile = 11.0;
    VertexShader = VertexShaderFunction;
    PixelShader = PixelShaderFunction;
    }
}

My matrix is calculated like this :

        Matrix MVP = Matrix.Multiply(Matrix.Multiply(Matrix.Identity, Matrix.LookAtLH(new Vector3(-10, 10, -10), new Vector3(0), new Vector3(0, 1, -0))), Camera.Projection);

        VoxelEffect.Parameters["MVP"].SetValue(MVP);

enter image description here Visual Studio Graphics Debug shows me that my vertex shader is actually working, but not the PixelShader. I striped the Shader to the bare minimums so that I was sure the shader was correct. But why is my screen still black?

© Game Development or respective owner

Related posts about rendering

Related posts about hlsl