Skip to content

Commit

Permalink
fix: first person lights (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
doodlum authored Jan 23, 2025
1 parent 109c469 commit 15abd18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.21)

project(
CommunityShaders
VERSION 1.1.14
VERSION 1.1.15
LANGUAGES CXX
)

Expand Down
9 changes: 6 additions & 3 deletions src/State.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 15abd18

Please sign in to comment.