From d922e6112f598f3e691d8d14520d2d05e57f4c56 Mon Sep 17 00:00:00 2001 From: Ralty <78720179+Raltyro@users.noreply.github.com> Date: Sun, 1 Mar 2026 18:23:26 +0700 Subject: [PATCH] Compatibility with old glsl version shader issues --- source/funkin/backend/system/Flags.hx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/funkin/backend/system/Flags.hx b/source/funkin/backend/system/Flags.hx index 03113c0a..c18104dd 100644 --- a/source/funkin/backend/system/Flags.hx +++ b/source/funkin/backend/system/Flags.hx @@ -275,7 +275,7 @@ class Flags { public static var DEFAULT_CHARACTER_GHOSTDISABLE_SOUND:String = "editors/character/ghostDisable"; public static var DEFAULT_CHARACTER_GHOSTENABLE_SOUND:String = "editors/character/ghostEnable"; - public static var DEFAULT_GLSL_VERSION:String = openfl.display.Shader.getDefaultGLVersion(); + @:lazy public static var DEFAULT_GLSL_VERSION:String = null; @:also(funkin.backend.utils.HttpUtil.userAgent) public static var USER_AGENT:String = 'request'; // -- End of Codename's Default Flags -- @@ -310,6 +310,15 @@ class Flags { if (USE_LEGACY_TIMING == null) USE_LEGACY_TIMING = MOD_API_VERSION < 2; if (USE_LEGACY_ZOOM_FACTOR == null) USE_LEGACY_ZOOM_FACTOR = MOD_API_VERSION < 2; if (SUSTAINS_AS_ONE_NOTE == null) SUSTAINS_AS_ONE_NOTE = MOD_API_VERSION >= 2; + if (DEFAULT_GLSL_VERSION == null) { + if (MOD_API_VERSION < 2) { + DEFAULT_GLSL_VERSION = "120"; + Logs.warn("Blend Mode Extensions won't work in MOD_API_VERSION below than 2"); + } + else { + DEFAULT_GLSL_VERSION = openfl.display.Shader.getDefaultGLVersion(); + } + } } public static function loadFromDatas(datas:Array):Map {