Jump to content
  • Advertisement
Sign in to follow this  
olivelarouille

DX11 DX11 full screen quad problem

This topic is 2551 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

Hi there,



This is my first post here and I would like to ask for some help or fresh ideas for debugging.



I am trying to draw a simple full screen quad using directX11.



I draw two triangles in the range (-1,1) in x and y. I use a pass through vertex shader and the fragment shader writed the pixel to red.



I checked the render target, and states but I can’t get to have anything on the screen.



I used PIX to debug the frame and the draw call seems to output the correct geometry to the viewport.

When I debug a pixel, there is no draw call event so I guess that the primitives are clipped, at least something wrong at the rasterizer stage...



I tried to change the order of the vertices, disabled depth clip but without succes...



Doesn any one has a suggestion on something I could be missing?



Thanks a lot.

Olive

Share this post


Link to post
Share on other sites
Advertisement
Have you created the device with the debug layer (so as to get D3D debug messages in your IDE)?

The event queue necessarily contains one or more draw events; otherwise, you haven't actually made any successful draw calls.

Share this post


Link to post
Share on other sites
Is the winding order of the vertices correct? (ie, is the triangle facing away from the camera and thus getting backface culled?) Need more, specific data

Share this post


Link to post
Share on other sites

In DirectX 11 screenspace is from (-width/2, -height/2) to (width/2, height/2), meaning (0, 0) point is center of screen, do you have that in mind when you setup your triangles?

Some extra info: http://www.rastertek.../dx11tut11.html


This only matters when rendering using an orthographic projection. After all projection is done, coordinates that eventually map to points in screen space inside the viewport are -1 to 1 in both directions.

To the OP, make sure you are you winding your triangles in the correct direction. The easiest way to check is to disable backface culling entirely to determine if you have a winding issue.

Share this post


Link to post
Share on other sites
Hi everyone,


Thanks for the suggestions and sorry for the late reply, I work on this project part time and I was buzy working on some opengl problems but this is another story.


I found a solution by creating the device in debug mode as suggested by Nik02.

I got the following error :
D3D11: ERROR: ID3D11Device::DrawIndexed: Rasterization Unit is enabled (PixelShader is not NULL or Depth/Stencil test is enabled) but position is not provided by the last shader before the Rasterization Unit. [ EXECUTION ERROR #362: DEVICE_DRAW_POSITION_NOT_PRESENT ]



Turned out that the outpu of my vertex shader had semantiv POSITION instead of SV_POSITION.

I am translating a whole bunch of shaders from DX9 to DX11 so this change didn't get my attention!


Thanks again!


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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!