An example from Frank D Luna's 3d Game Programming with Dx11 shows the following effect technique:

technique11 DrawTech
pass P0
    SetVertexShader(   CompileShader( vs_5_0, DrawVS() ) );
    SetGeometryShader( CompileShader( gs_5_0, DrawGS() ) );
    SetPixelShader(    CompileShader( ps_5_0, DrawPS() ) );

    SetBlendState(AdditiveBlending, float4(0.0f, 0.0f, 0.0f, 0.0f), 0xffffffff);
    SetDepthStencilState( NoDepthWrites, 0 );

Setting depth stencil state, blend states etc (and restoring them to previous state) when the Effects library isn't available is my goal.

I've had a hard time finding examples on this though. Luna sidesteps the issue by using the effects framework in his book.

To complicate the issue, I'm using DXUT11 (for loading in meshes).

Can anyone help with an example or an svn repository that includes an example?


in the ID3D11DeviceContext, there is such function calls.

they are :

if you look at this website all of the things are listed here, and there you find how you use them and how they work.


for restoring to the last state, you have to have some kind of state machine implementation in your code, that stores the last used state. DX does not do this for you.

Eventualy, the effect library is using thees commands aswell, just that it has some extra stuff with it ( which i really hate ), so you can infact build your own effect system with this and use it more efficent than what you have in dx10/11.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.