Skip to content

Commit

Permalink
Add more PostFX stuff to disable
Browse files Browse the repository at this point in the history
- Disable additive_overlay_color
- Disable color_grading

This prevents any color shift that may happen on freezing/snowing weather.
Which only happens in December, January or February.
  • Loading branch information
Dadido3 committed Feb 4, 2024
1 parent ace1ab1 commit 93a1283
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions files/modification.lua
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@ function Modification.PatchFiles(patches)
end
ModTextFileSetContent("data/shaders/post_final.frag", postFinal)
end
if patches.PostFinalReplace then
local postFinal = ModTextFileGetContent("data/shaders/post_final.frag")
for k, v in pairs(patches.PostFinalReplace) do
postFinal = postFinal:gsub(k, v)
end
ModTextFileSetContent("data/shaders/post_final.frag", postFinal)
end
end

---Returns tables with user requested game configuration changes.
Expand Down Expand Up @@ -361,6 +368,14 @@ function Modification.RequiredChanges()
FOG_FOREGROUND_NIGHT = "vec4(0.0,0.0,0.0,1.0)",
FOG_BACKGROUND_NIGHT = "vec3(0.0,0.0,0.0)",
}

-- Disable color grading, which may make the world look a tad more blue when there is freezing/snowing weather.
-- This is dependent on the seed and the PC's wall clock, and it only snows in December, January or February.
patches.PostFinalReplace = {
["color%.rgb = mix%( color, additive_overlay_color%.rgb, additive_overlay_color%.a %);"] = "",
["color = mix%(color, vec3%(%(color%.r %+ color%.g %+ color%.b%) %* 0%.3333%), color_grading%.a%);"] = "",
["color = color %* color_grading%.rgb;"] = "// Here lies the remains of the tone-mapping/color grading code. 2019-2024. RIP",
}
end

if ModSettingGet("noita-mapcap.disable-shaders-gui-ai") and DebugAPI.IsDevBuild() then
Expand Down

0 comments on commit 93a1283

Please sign in to comment.