From d63501aa07821ba79ae0b0ebf9e9f53b714a25c8 Mon Sep 17 00:00:00 2001 From: Bottinator22 <59987380+Bottinator22@users.noreply.github.com> Date: Sat, 28 Dec 2024 19:58:18 -0800 Subject: [PATCH] Add files via upload --- .../opensb/universeclient/loadconfig.lua | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 assets/opensb/scripts/opensb/universeclient/loadconfig.lua diff --git a/assets/opensb/scripts/opensb/universeclient/loadconfig.lua b/assets/opensb/scripts/opensb/universeclient/loadconfig.lua new file mode 100644 index 0000000..2bb3ef8 --- /dev/null +++ b/assets/opensb/scripts/opensb/universeclient/loadconfig.lua @@ -0,0 +1,22 @@ +-- Meant to manage loading various miscellaneous things from configuration, such as shader parameters. + +local module = {} +modules.config_loader = module + +function module.init() + local shaderConfig = root.getConfiguration("postProcessGroups") or {} + local postProcessGroups = renderer.postProcessGroups() + local changes = false + for k,v in next, shaderConfig do + local group = postProcessGroups[k] + if v.parameters then + for k2,v2 in next, group.parameters do + if v.parameters[k2] ~= nil then + for _,e in next, v2.effects do + renderer.setEffectParameter(e,k2,v.parameters[k2]) + end + end + end + end + end +end