diff --git a/leenkx/Sources/leenkx/renderpath/Inc.hx b/leenkx/Sources/leenkx/renderpath/Inc.hx index 345a25b..8f15a4f 100644 --- a/leenkx/Sources/leenkx/renderpath/Inc.hx +++ b/leenkx/Sources/leenkx/renderpath/Inc.hx @@ -529,15 +529,21 @@ class Inc { public static function applyConfig() { #if lnx_config var config = leenkx.data.Config.raw; + + #if rp_chromatic_aberration + Postprocess.chromatic_aberration_uniforms[3] = config.rp_chromatic_aberration == true ? 1 : 0; + #end + // Resize shadow map var l = path.light; - if (l.data.raw.type == "sun" && l.data.raw.shadowmap_size != config.rp_shadowmap_cascade) { - l.data.raw.shadowmap_size = config.rp_shadowmap_cascade; - var rt = path.renderTargets.get("shadowMap"); - if (rt != null) { - rt.unload(); - path.renderTargets.remove("shadowMap"); - } + if (l != null){ + if (l.data.raw.type == "sun" && l.data.raw.shadowmap_size != config.rp_shadowmap_cascade) { + l.data.raw.shadowmap_size = config.rp_shadowmap_cascade; + var rt = path.renderTargets.get("shadowMap"); + if (rt != null) { + rt.unload(); + path.renderTargets.remove("shadowMap"); + } } else if (l.data.raw.shadowmap_size != config.rp_shadowmap_cube) { l.data.raw.shadowmap_size = config.rp_shadowmap_cube;