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

64 lines
2.0 KiB
Plaintext

-- @ Version: SCREEN SPACE SHADERS - UPDATE 21
-- @ Description: AO script
-- @ Author: https://www.moddb.com/members/ascii1457
-- @ Mod: https://www.moddb.com/mods/stalker-anomaly/addons/screen-space-shaders
-- Settings
local ssfx_ao_quality = 0
local ssfx_ao_res = 0
local ssfx_ao_distance = 0
local ssfx_ao_blur = 0
local ssfx_ao_radius = 0
local ssfx_ao_max_occ = 0
local ssfx_ao_global_int = 0
local ssfx_ao_hud_int = 0
local ssfx_ao_flora_int = 0
-- Internal vars
module_installed = true
local function apply_ao_settings()
-- Apply commands
get_console():execute("ssfx_ao_quality " .. ssfx_ao_quality)
get_console():execute("ssfx_ao (" .. ssfx_ao_res .. "," .. ssfx_ao_global_int .. "," .. ssfx_ao_blur .. "," .. ssfx_ao_radius .. ")")
get_console():execute("ssfx_ao_setup1 (" .. ssfx_ao_distance .. "," .. ssfx_ao_hud_int .. ", " .. ssfx_ao_flora_int .. "," .. ssfx_ao_max_occ .. ")")
end
local function update_settings()
-- Get settings
module_id = "ao"
ssfx_ao_quality = ssfx_001_mcm.ssfx_get_setting(module_id, "quality", ssfx_ao_settings)
ssfx_ao_res = ssfx_001_mcm.ssfx_get_setting(module_id, "res", ssfx_ao_settings)
ssfx_ao_distance = ssfx_001_mcm.ssfx_get_setting(module_id, "distance", ssfx_ao_settings)
ssfx_ao_blur = ssfx_001_mcm.ssfx_get_setting(module_id, "blur", ssfx_ao_settings)
ssfx_ao_radius = ssfx_001_mcm.ssfx_get_setting(module_id, "radius", ssfx_ao_settings)
ssfx_ao_max_occ = ssfx_001_mcm.ssfx_get_setting(module_id, "max_occ", ssfx_ao_settings)
ssfx_ao_global_int = ssfx_001_mcm.ssfx_get_setting(module_id, "global_int", ssfx_ao_settings) * 5
ssfx_ao_hud_int = ssfx_001_mcm.ssfx_get_setting(module_id, "hud_int", ssfx_ao_settings)
ssfx_ao_flora_int = ssfx_001_mcm.ssfx_get_setting(module_id, "flora_int", ssfx_ao_settings)
ssfx_ao_res = 1.0 / ssfx_ao_res
-- Apply settings
apply_ao_settings()
end
function on_game_start()
-- General Functions
RegisterScriptCallback("on_option_change", update_settings)
-- Read and apply settigns
update_settings()
end