DX11 full screen quad problem

Started by
5 comments, last by olivelarouille 12 years, 9 months ago
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
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.

Niko Suni

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

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.
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!


And for the way I draw the vertices, I send them directly in the range -1,1 so I don't have to use an orthographic projection.

This topic is closed to new replies.

Advertisement