DirectX 11 - Depth Buffer

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

Brouilles
Just popping in
Just popping in
Posts: 3
Joined: Mon Oct 31, 2016 15:13

DirectX 11 - Depth Buffer

Postby Brouilles » Mon Oct 31, 2016 15:18

Hi, I have a problem with the Depth Buffer context of my DirectX 11 when viewing the menu. The Depth Buffer, which is activated, works perfectly if I do not show the menu. I clear at every frame.

Code: Select all

//Type of variable
CEGUI::Direct3D11Renderer*  m_pRenderer;
CEGUI::GUIContext*          m_pContext;

//Call render
m_pRenderer->beginRendering();
        m_pContext->draw(); // <-- this line must disable buffer, after being called once the buffer is deactivated until the end of the program
m_pRenderer->endRendering();


It is normal that the buffer is disabled for UI, but I not understand why he does not wake up later.

Code: Select all

m_renderingEngine.Restore();
        m_game.Render();
        m_GUI.Draw();
m_renderingEngine.Clear();


So m_renderingEngine.Restore(); :

Code: Select all

m_deviceContext->ClearRenderTargetView(m_pRenderTargetView, D3DXCOLOR(0.0f, 0.2f, 0.4f, 1.0f));
m_deviceContext->ClearDepthStencilView(m_pDepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0);


and m_pRenderer->endRendering(); :

Code: Select all

m_swapchain->Present(0, 0); //Switch the back to front buffer
D3DXMatrixIdentity(&m_worldMatrix);


Image

Cegui Version: 0.8.7.

Thank you for your answers.

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: DirectX 11 - Depth Buffer

Postby YaronCT » Tue Nov 01, 2016 07:27

@Brouilles: Thanx for (re)reporting the problem! We'll look into it.

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: DirectX 11 - Depth Buffer

Postby YaronCT » Sat Nov 12, 2016 18:06

As my knowledge in DirectX equals the abosulute 0, and honestly, I prefer to keep it that way, I find it difficult to tackle this problem. I hereby assign this to our #1 DirectX expert.

@Ident: Any way u can give it a look? Grepping for "depth" in "cegui/src/RendererModules/Direct3D11/shader.txt" definitely gives a few results where it seems like the depth buffer is disabled. However that's the most I can make of it..

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: DirectX 11 - Depth Buffer

Postby Ident » Sat Nov 12, 2016 21:11

I am actually a total OpenGL guy. Although I did write the new Direct3D 11 renderer on default (not the 0.8.X one), it was tough for me and mostly done using my OpenGL knowledge and with the goal to unify our rendering system for easier maintainability. I just followed the status-quo on our practices there.

In OpenGLRenderer 2 and 3 we use a function called "enableExtraStateSettings", which, if true, will reset all states to default or previous values after rendering. The API docu reveals that the D3D11 renderer doesnt have such a function and I do not know what the best practice here is for Direct3D on this matter.

Would it fix your problem if you reactivated the depth buffer each time after rendering CEGUI? As well as everything else that might be altered?
CrazyEddie: "I don't like GUIs"


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 3 guests