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

49 lines
1.6 KiB
Plaintext
Raw Normal View History

-- @ Version: SCREEN SPACE SHADERS - UPDATE 22
-- @ Description: SSS script
-- @ Author: https://www.moddb.com/members/ascii1457
-- @ Mod: https://www.moddb.com/mods/stalker-anomaly/addons/screen-space-shaders
-- SSS setup
local ssfx_sss_dir_quality = 0
local ssfx_sss_omni_quality = 0
local ssfx_sss_enable_dir = 0
local ssfx_sss_enable_omni = 0
local ssfx_sss_len_dir = 0
local ssfx_sss_len_omni = 0
-- Samples, Range, Height, Water Limit
function apply_sss_settings()
get_console():execute("ssfx_sss_quality (" .. ssfx_sss_dir_quality .. "," .. ssfx_sss_omni_quality .. "," .. (ssfx_sss_enable_dir and 1 or 0) .. "," .. (ssfx_sss_enable_omni and 1 or 0) .. ")")
get_console():execute("ssfx_sss (" .. ssfx_sss_len_dir .. "," .. ssfx_sss_len_omni .. ",0,0)")
end
function on_option_change()
-- Get settings
ssfx_sss_dir_quality = ssfx_001_mcm.ssfx_get_setting("sss", "quality_dir", ssfx_sss_settings)
ssfx_sss_omni_quality = ssfx_001_mcm.ssfx_get_setting("sss", "quality_point", ssfx_sss_settings)
ssfx_sss_enable_dir = ssfx_001_mcm.ssfx_get_setting("sss", "enable_dir", ssfx_sss_settings)
ssfx_sss_enable_omni = ssfx_001_mcm.ssfx_get_setting("sss", "enable_point", ssfx_sss_settings)
ssfx_sss_len_dir = ssfx_001_mcm.ssfx_get_setting("sss", "len_dir", ssfx_sss_settings)
ssfx_sss_len_omni = ssfx_001_mcm.ssfx_get_setting("sss", "len_point", ssfx_sss_settings)
-- Apply settings
apply_sss_settings()
end
function on_game_start()
-- General Functions
RegisterScriptCallback("on_option_change", on_option_change)
-- Read and apply settigns
on_option_change()
end