# How to draw HUD in DirectX12?

I would like to draw reference frame to see how my camera moves around scene. I want these arrows to always be on the top of other geometry. How can I achieve it?

I think I need to disable depth test for this draw calls. Should I use just another PSO with changed DepthStencilState?

EDIT: Well, it works for me like that.

// opaquePsoDesc defined somewhere above
D3D12_GRAPHICS_PIPELINE_STATE_DESC opaqueHudPsoDesc = opaquePsoDesc;
opaqueHudPsoDesc.DepthStencilState.DepthEnable = false;
THROW_IF_FAILED(g_device->CreateGraphicsPipelineState(&opaqueHudPsoDesc, IID_PPV_ARGS(&psos_["opaque_HUD"])));


And then before drawing your HUD you can:

commandList->SetPipelineState(psos_["opaque_HUD"].Get());


I'll leave this answer here, in case someone will need it.

Well, that works fine if you don't want depth test for the HUD objects.

• You can actually post an answer to your own question and close it yourself. That way it doesn't stay open and unanswered :) – Honeybunch Dec 31 '16 at 19:46

See DirectX Tool Kit for DirectX 12 and in particular the SpriteFont and SpriteBatch classes.