Skip to content

Commit

Permalink
Add forgotten culling state changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SaiyansKing committed Dec 4, 2021
1 parent 9b639ff commit 45f785d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions D3D11Engine/D3D11GraphicsEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5041,6 +5041,10 @@ void D3D11GraphicsEngine::DrawVobSingle( VobInfo* vob ) {
GetContext()->OMSetRenderTargets( 1, HDRBackBuffer->GetRenderTargetView().GetAddressOf(),
DepthStencilBuffer->GetDepthStencilView().Get() );

// Set backface culling
Engine::GAPI->GetRendererState().RasterizerState.CullMode = GothicRasterizerStateInfo::CM_CULL_BACK;
Engine::GAPI->GetRendererState().RasterizerState.SetDirty();

XMMATRIX view = Engine::GAPI->GetViewMatrixXM();
Engine::GAPI->SetViewTransformXM( view );

Expand Down Expand Up @@ -5074,6 +5078,10 @@ void D3D11GraphicsEngine::DrawVobSingle( VobInfo* vob ) {
}

GetContext()->OMSetRenderTargets( 1, HDRBackBuffer->GetRenderTargetView().GetAddressOf(), nullptr );

// Disable culling again
Engine::GAPI->GetRendererState().RasterizerState.CullMode = GothicRasterizerStateInfo::CM_CULL_NONE;
Engine::GAPI->GetRendererState().RasterizerState.SetDirty();
}

/** Draws a multiple VOBs (used for inventory) */
Expand All @@ -5099,6 +5107,10 @@ void D3D11GraphicsEngine::DrawVobsList( const std::list<VobInfo*>& vobs, zCCamer
GetContext()->OMSetRenderTargets( 1, HDRBackBuffer->GetRenderTargetView().GetAddressOf(),
DepthStencilBuffer->GetDepthStencilView().Get() );

// Set backface culling
Engine::GAPI->GetRendererState().RasterizerState.CullMode = GothicRasterizerStateInfo::CM_CULL_BACK;
Engine::GAPI->GetRendererState().RasterizerState.SetDirty();

SetActivePixelShader( "PS_Preview_Textured" );
SetActiveVertexShader( "VS_Ex" );

Expand Down Expand Up @@ -5131,6 +5143,10 @@ void D3D11GraphicsEngine::DrawVobsList( const std::list<VobInfo*>& vobs, zCCamer
}

GetContext()->OMSetRenderTargets( 1, HDRBackBuffer->GetRenderTargetView().GetAddressOf(), nullptr );

// Disable culling again
Engine::GAPI->GetRendererState().RasterizerState.CullMode = GothicRasterizerStateInfo::CM_CULL_NONE;
Engine::GAPI->GetRendererState().RasterizerState.SetDirty();
}

/** Update clipping cursor onto window */
Expand Down

0 comments on commit 45f785d

Please sign in to comment.