Divergent/mods/Screen Space Shaders/gamedata/scripts/ssfx_pp_bloom.script

62 lines
2.0 KiB
Plaintext

-- @ Version: SCREEN SPACE SHADERS - UPDATE 22
-- @ Description: Bloom script
-- @ Author: https://www.moddb.com/members/ascii1457
-- @ Mod: https://www.moddb.com/mods/stalker-anomaly/addons/screen-space-shaders
-- Settings
local ssfx_bloom_use_weather = 0
local ssfx_bloom_threshold = 0
local ssfx_bloom_exposure = 0
local ssfx_bloom_blur = 0
local ssfx_bloom_vibrance = 0
local ssfx_bloom_sky = 0
local ssfx_bloom_lens = 0
local ssfx_bloom_dirt = 0
-- Internal vars
module_installed = true
local function apply_bloom_settings()
-- Apply commands
get_console():execute("ssfx_bloom_use_presets " .. (ssfx_bloom_use_weather and 1 or 0))
get_console():execute("ssfx_bloom_1 (" .. ssfx_bloom_threshold .. "," .. ssfx_bloom_exposure .. ",0," .. ssfx_bloom_sky .. ")")
get_console():execute("ssfx_bloom_2 (" .. ssfx_bloom_blur .. "," .. ssfx_bloom_vibrance .. ", " .. ssfx_bloom_lens .. "," .. ssfx_bloom_dirt .. ")")
end
local function update_settings()
-- Get settings
module_id = "ssfx_pp/ssfx_bloom"
ssfx_bloom_use_weather = ssfx_001_mcm.ssfx_get_setting(module_id, "use_weather", ssfx_pp_bloom_settings)
ssfx_bloom_threshold = ssfx_001_mcm.ssfx_get_setting(module_id, "threshold", ssfx_pp_bloom_settings)
ssfx_bloom_exposure = ssfx_001_mcm.ssfx_get_setting(module_id, "exposure", ssfx_pp_bloom_settings)
ssfx_bloom_blur = ssfx_001_mcm.ssfx_get_setting(module_id, "blur", ssfx_pp_bloom_settings)
ssfx_bloom_vibrance = ssfx_001_mcm.ssfx_get_setting(module_id, "vibrance", ssfx_pp_bloom_settings)
ssfx_bloom_sky = ssfx_001_mcm.ssfx_get_setting(module_id, "sky", ssfx_pp_bloom_settings)
ssfx_bloom_lens = ssfx_001_mcm.ssfx_get_setting(module_id, "lens", ssfx_pp_bloom_settings)
ssfx_bloom_dirt = ssfx_001_mcm.ssfx_get_setting(module_id, "dirt", ssfx_pp_bloom_settings)
-- Apply settings
apply_bloom_settings()
end
function on_game_start()
-- General Functions
RegisterScriptCallback("on_option_change", update_settings)
-- Read and apply settigns
update_settings()
end