From 15abd18e1d6ce2c2f70e99e4ed410f1645ac8a7e Mon Sep 17 00:00:00 2001 From: doodlum <15017472+doodlum@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:49:56 +0000 Subject: [PATCH] fix: first person lights (#917) --- CMakeLists.txt | 2 +- src/State.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97aabade9..245ae3b74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.21) project( CommunityShaders - VERSION 1.1.14 + VERSION 1.1.15 LANGUAGES CXX ) diff --git a/src/State.cpp b/src/State.cpp index 893b6a4ce..85431e88e 100644 --- a/src/State.cpp +++ b/src/State.cpp @@ -28,6 +28,7 @@ void State::Draw() auto terrainBlending = variableCache->terrainBlending; auto cloudShadows = variableCache->cloudShadows; auto truePBR = variableCache->truePBR; + auto smState = variableCache->smState; if (shaderCache->IsEnabled()) { if (terrainBlending->loaded) @@ -38,9 +39,11 @@ void State::Draw() truePBR->SetShaderResouces(context); - // Set an unused bit to indicate if we are rendering an object in the main rendering pass - if (deferred->inWorld) { - currentExtraDescriptor |= (uint32_t)ExtraShaderDescriptors::InWorld; + if (auto accumulator = RE::BSGraphics::BSShaderAccumulator::GetCurrentAccumulator()) { + // Set an unused bit to indicate if we are rendering an object in the main rendering passes + if (accumulator->GetRuntimeData().activeShadowSceneNode == smState->shadowSceneNode[0]) { + currentExtraDescriptor |= (uint32_t)ExtraShaderDescriptors::InWorld; + } } if (deferred->inDecals)