From 9573f1660823879d2af39873dd1cc8f743bcef92 Mon Sep 17 00:00:00 2001 From: SaiyansKing <38609240+SaiyansKing@users.noreply.github.com> Date: Sat, 3 Jul 2021 14:30:46 +0200 Subject: [PATCH] Fix dynamic shadows Fix winding order when rendering skeletal meshes within dynamic shadows that makes some lights disappear --- D3D11Engine/GothicAPI.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/D3D11Engine/GothicAPI.cpp b/D3D11Engine/GothicAPI.cpp index 8df8ca0d..f3be75f5 100644 --- a/D3D11Engine/GothicAPI.cpp +++ b/D3D11Engine/GothicAPI.cpp @@ -804,6 +804,7 @@ void GothicAPI::DrawWorldMeshNaive() { START_TIMING(); if ( RendererState.RendererSettings.DrawSkeletalMeshes ) { // Set up frustum for the camera + RendererState.RasterizerState.SetDefault(); zCCamera::GetCamera()->Activate(); for ( const auto& vobInfo : AnimatedSkeletalVobs ) { @@ -1568,7 +1569,6 @@ void GothicAPI::DrawSkeletalMeshVob( SkeletalVobInfo* vi, float distance ) { D3D11GraphicsEngine* g = (D3D11GraphicsEngine*)Engine::GraphicsEngine; // Setup renderstate - RendererState.RasterizerState.SetDefault(); RendererState.RasterizerState.CullMode = GothicRasterizerStateInfo::CM_CULL_FRONT; RendererState.RasterizerState.SetDirty(); @@ -1740,6 +1740,7 @@ void GothicAPI::DrawSkeletalGhosts() { D3D11GraphicsEngine* g = (D3D11GraphicsEngine*)Engine::GraphicsEngine; if ( !GhostSkeletalVobs.empty() ) { // Setup alpha blending + RendererState.RasterizerState.SetDefault(); RendererState.BlendState.SetAlphaBlending(); RendererState.BlendState.SetDirty(); RendererState.DepthState.SetDefault();