diff --git a/src/core/platform.js b/src/core/platform.js index 33d61b8705f..fb708b73af2 100644 --- a/src/core/platform.js +++ b/src/core/platform.js @@ -52,6 +52,15 @@ const passiveEvents = detectPassiveEvents(); * } */ const platform = { + /** + * String identifying the current platform. Can be one of: android, ios, windows, osx, linux, + * cros or null. + * + * @type {'android' | 'ios' | 'windows' | 'osx' | 'linux' | 'cros' | null} + * @ignore + */ + name: platformName, + /** * String identifying the current runtime environment. Either 'browser' or 'node'. * diff --git a/src/platform/graphics/webgl/webgl-graphics-device.js b/src/platform/graphics/webgl/webgl-graphics-device.js index 48456777d80..3858f3e4d6e 100644 --- a/src/platform/graphics/webgl/webgl-graphics-device.js +++ b/src/platform/graphics/webgl/webgl-graphics-device.js @@ -354,6 +354,20 @@ class WebglGraphicsDevice extends GraphicsDevice { Debug.log("Antialiasing has been turned off due to rendering issues on AppleWebKit 15.4"); } + // #5856 - turn off antialiasing on Windows Firefox + if (platform.browserName === 'firefox' && platform.name === 'windows') { + const ua = (typeof navigator !== 'undefined') ? navigator.userAgent : ''; + const match = ua.match(/Firefox\/(\d+(\.\d+)*)/); + const firefoxVersion = match ? match[1] : null; + if (firefoxVersion) { + const version = parseFloat(firefoxVersion); + if (version >= 120 || version === 115) { + options.antialias = false; + Debug.log("Antialiasing has been turned off due to rendering issues on Windows Firefox esr115 and 120+. Current version: " + firefoxVersion); + } + } + } + let gl = null; // we always allocate the default framebuffer without antialiasing, so remove that option