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

44 lines
1.4 KiB
Plaintext
Raw Normal View History

-- @ Version: SCREEN SPACE SHADERS - UPDATE 22
-- @ Description: Terrain script
-- @ Author: https://www.moddb.com/members/ascii1457
-- @ Mod: https://www.moddb.com/mods/stalker-anomaly/addons/screen-space-shaders
-- Terrain setup
local ssfx_pom_quality = 0
local ssfx_pom_refine = 0
local ssfx_pom_range = 0
local ssfx_pom_height = 0
local ssfx_pom_ao = 0
-- Samples, Range, Height, Water Limit
function apply_parallax_settings()
get_console():execute("ssfx_pom (" .. ssfx_pom_quality .. "," .. ssfx_pom_range .. "," .. ssfx_pom_height .."," .. ssfx_pom_ao .. ")")
get_console():execute("ssfx_pom_refine " .. (ssfx_pom_refine and 1 or 0))
end
function on_option_change()
-- Get settings
ssfx_pom_quality = ssfx_001_mcm.ssfx_get_setting("parallax", "quality", ssfx_parallax_settings)
ssfx_pom_refine = ssfx_001_mcm.ssfx_get_setting("parallax", "refine", ssfx_parallax_settings)
ssfx_pom_range = ssfx_001_mcm.ssfx_get_setting("parallax", "range", ssfx_parallax_settings)
ssfx_pom_height = ssfx_001_mcm.ssfx_get_setting("parallax", "height", ssfx_parallax_settings)
ssfx_pom_ao = ssfx_001_mcm.ssfx_get_setting("parallax", "ao", ssfx_parallax_settings)
-- Apply settings
apply_parallax_settings()
end
function on_game_start()
-- General Functions
RegisterScriptCallback("on_option_change", on_option_change)
-- Read and apply settigns
on_option_change()
end