After Fiddling around I am pretty sure this is not a Shader issue.

Edit 4: The only diference I can see is that BasicEffect calls these methods before drawing:

 // Make sure that domain, hull and geometry shaders are disable.

So I tried this:

    Profile = 11.0;
    // TODO: set renderstates here.
    GeometryShader = NULL;
    HullShader = NULL;
    DomainShader = NULL;
    VertexShader = VertexShaderFunction;
    PixelShader = PixelShaderFunction;


Still it doesnt render anything. Maybe this will someone to get a idea.

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);


enter image description here I am currently Using it with Matrix.Identity.

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?

EDIT: Before people start saying that this is duplicated of

DirectX11 pixel shader in pipeline is missing

I already checked that a few others, and none of the answers solved my issue.



This shows a quad on screen, as it should so the problem is not on my Shader code. Still I am baffled, I am doing this using another call which if I use the default BasicEffect class renders fine but if I use mine it doesnt show anything:

        VertexPositionNormalTexture[] QuadsVertices = new VertexPositionNormalTexture[]
            new VertexPositionNormalTexture(new Vector3(-1, 1, 0),Vector3.Zero,new Vector2(0, 0)),
            new VertexPositionNormalTexture(new Vector3(1, 1, 0), Vector3.Zero,new Vector2(1, 0)),
            new VertexPositionNormalTexture(new Vector3(-1, -1, 0), Vector3.Zero,new Vector2(0, 1)),
            new VertexPositionNormalTexture(new Vector3(1, -1, 0), Vector3.Zero,new Vector2(1, 1)),
        Matrix MVP = Matrix.Identity;

  g.Draw(MyEffect); //This renders nothing

Using Quad Render I get a nice Quad on the screen. So what could possibly be the issue here?

  • \$\begingroup\$ Is your vertex shader actually mapping to values on the screen? The pixel shader only runs for fragments that aren't clipped/culled which happens after the vertex shader runs. Your MVP matrix may be bad. Try drawing with an identity matrix and a full-screen quad. \$\endgroup\$ Commented Jun 8, 2014 at 23:07
  • \$\begingroup\$ @SeanMiddleditch I tried that, MVP I set as identiy in the Visual Studio you can see that the VertexShader does display my model. I also tried Quad Rendering it shows the same but with a quad, still nothing is rendered. Other thing : I tried the same matrix and model with another (Basic Effect from SharpDx) it renders, so something is wrong with my Shader? but I don't know what :\ \$\endgroup\$
    – Morphex
    Commented Jun 8, 2014 at 23:20
  • \$\begingroup\$ Heh, call it a blackbuffer badum tss \$\endgroup\$
    – MickLH
    Commented Jun 9, 2014 at 2:35
  • \$\begingroup\$ That would be a more suitable name for it right now, although it sucks since I am pretty much clueless on what is wrong and what to do to fix it. \$\endgroup\$
    – Morphex
    Commented Jun 9, 2014 at 2:37


You must log in to answer this question.

Browse other questions tagged .