Jump to content
  • Advertisement
Sign in to follow this  
pnt1614

Why is the pixel shader not being called?

This topic is 1838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just follow a directx tutorial, but there is nothing in the screen. Therefore, I try to debug with PIX, and the result is the pixel shader is not being called

 

pipelinev.jpg

 

I do not know why the pixel shader is not being called, even I create and set a pixel shader to the pipeline. Anybody have experienced this problem? Please, help me. Thank you

Share this post


Link to post
Share on other sites
Advertisement

There are a number of ways that you can eliminate geometry from the pipeline before it gets to the pixel shader.  The most likely are related to the geometry not being within the clipping volume after exiting the vertex shader.  I see some of your vertices after the VS have a w value of > 1.0, which means at least some of the vertices are outside of the viewing area.  Double check the output vertices to ensure they are as you expect them to be.

 

Next could be that the vertex winding is not correct, and the triangles are being eliminated for back face culling.  For debugging you can disable culling in the rasterizer state to ensure this isn't the case.  This most likely isn't the issue since a cube would have at least partial geometry showing up from either the front or back triangles.

 

Finally, you have to have the rasterizer generating the pixels to be invoked in the pixel shader.  This requires that a viewport be set, and that you aren't using failing the scissor test.  Double check that you aren't configuring the scissor test to be active, and that you have set a valid viewport prior to drawing.

Share this post


Link to post
Share on other sites

Looks like you're sitting right within your cube. As Jason said, if the culling disables back-faces your cube vanishes completely now.

 

Additional things to try

- For orthographic projection: increase width, height and z-range or alternatively scale your model down (World transformation)

- For perspective projection: Move your camera further away and increase the far plane

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!