Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package/Shaders/Common/SharedData.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ namespace SharedData
float SkyIBLSaturation;
float FogAmount;
uint DALCMode; // 0: Luminance Ratio, 1: Color Ratio, 2: DALC + Sky
float2 pad0;
uint DisableInInteriors;
float pad0;
};

struct ExtendedTranslucencySettings
Expand Down
14 changes: 6 additions & 8 deletions src/Features/IBL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
EnvIBLSaturation,
SkyIBLSaturation,
FogAmount,
DALCMode)
DALCMode,
DisableInInteriors)

void IBL::DrawSettings()
{
Expand Down Expand Up @@ -76,7 +77,7 @@ void IBL::DrawSettings()
if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text("When Fog Mix is active, rescales the IBL-tinted fog to keep the original fog brightness.\nPrevents fog from becoming too bright or too dark.");
}
ImGui::Checkbox("Disable in interiors", &disableInInteriors);
ImGui::Checkbox("Disable in interiors", (bool*)&settings.DisableInInteriors);
if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text("Disables IBL in interior cells.");
}
Expand All @@ -85,19 +86,16 @@ void IBL::DrawSettings()
void IBL::LoadSettings(json& o_json)
{
settings = o_json;
disableInInteriors = o_json.value("DisableInInteriors", false);
}

void IBL::SaveSettings(json& o_json)
{
o_json = settings;
o_json["DisableInInteriors"] = disableInInteriors;
}

void IBL::RestoreDefaultSettings()
{
settings = {};
disableInInteriors = false;
}

void IBL::RegisterWeatherVariables()
Expand Down Expand Up @@ -173,7 +171,7 @@ void IBL::RegisterWeatherVariables()
IBL::Settings IBL::GetCommonBufferData() const
{
Settings data = settings;
if (disableInInteriors && Util::IsInterior())
if (settings.DisableInInteriors && Util::IsInterior())
data.EnableIBL = 0;
return data;
}
Expand All @@ -183,7 +181,7 @@ void IBL::ReflectionsPrepass()
if (loaded) {
auto context = globals::d3d::context;

bool interiorDisabled = disableInInteriors && Util::IsInterior();
bool interiorDisabled = settings.DisableInInteriors && Util::IsInterior();

// Set PS shader resource
{
Expand All @@ -200,7 +198,7 @@ void IBL::ReflectionsPrepass()

void IBL::Prepass()
{
if (disableInInteriors && Util::IsInterior())
if (settings.DisableInInteriors && Util::IsInterior())
return;

auto context = globals::d3d::context;
Expand Down
4 changes: 1 addition & 3 deletions src/Features/IBL.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ struct IBL : Feature
virtual void SetupResources() override;
virtual void ClearShaderCache() override;

bool disableInInteriors = false;

struct Settings
{
uint EnableIBL = 0;
Expand All @@ -55,7 +53,7 @@ struct IBL : Feature
float SkyIBLSaturation = 1.0f;
float FogAmount = 0.0f;
uint DALCMode = 2; // 0: Luminance Ratio, 1: Color Ratio, 2: DALC + Sky
float pad0 = 0.0f;
uint DisableInInteriors = 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Preserve prior default unless behavior change is intentional.

Line 56 initializes DisableInInteriors to 1. If this PR is refactor-only, this changes default runtime behavior for missing/new configs.

🔧 Proposed fix
-		uint DisableInInteriors = 1;
+		uint DisableInInteriors = 0;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Features/IBL.h` at line 56, The field DisableInInteriors was given a
default value of 1 which alters runtime behavior; revert this to the prior
default (remove or change the initializer on DisableInInteriors in IBL.h so it
matches the original default value used before this PR) so refactor-only changes
do not change behavior—locate the DisableInInteriors declaration in class/struct
IBL and restore its previous default initialization (or leave uninitialized if
that was the prior state) to preserve existing behavior.

float pad1 = 0.0f;
} settings;

Expand Down
Loading