Question

I need to know my current culling mode. I would to like to get D3D11_RASTERIZER_DESC filled by some function. Is it possible? How? Or i only can set states but not get them?

I dodn't set it, but i want to know the default settings.

Was it helpful?

Solution

You can't get the cull mode by ID3D11DeviceContext::RSGetState unless you set it first, or you will get null pointer.(I test this on my code)

Let's dig it a bit more,

in DirectX 9, the default cull mode is D3DCULL_CCW, we when say culling, we always refer to back face culling, so what is back face? a front face is one in which vertices are defined in clockwise order.Any face that is not a front face is a back face. Direct3D does not always render back faces; therefore, back faces are said to be culled.

In DirectX 10, whether a face is front or back depends on you, there is filed called FrontCounterClockwise in D3D10_RASTERIZER_DESC, and it's default value is FALSE, and the deault cull mode is D3D10_CULL_BACK, same as DirectX 9.

In DirectX 11, the D3D11_RASTERIZER_DESC has same members as that in DirectX 10, but unfortunately, the document didn't specify the default value of cull mode.

I guess DirectX 11 will also use D3D11_CULL_BACK by default. When you defined a triangle in clockwise order and render it, everything works fine, but when you change it to counter-close wise, you will see nothing.

EDIT: See the remark section of this page, it give the default values. thanks MooseBoys for point this out.

OTHER TIPS

I believe you want to look at the ID3D11DeviceContext::RSGetState method. You should then be able to get the description from the ID3D11RasterizerState output argument.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top