With Firefox (Developer Edition 97.0b6, 64-bit)
loading script babylon.max.js logs a warning:
WEBGL_debug_renderer_info is deprecated in Firefox and will be removed. Please use RENDERER. thinEngine.ts:1113:41
Babylon.js v5.0.0-beta.4 - WebGL2
Could I avoid this or has Babylon to be adapted?
And if Firefox removes it, will Babylon still work?
RaananW
January 24, 2022, 12:47pm
#2
Babylon will continue working and has a fallback for this. This is the code using this extension:
// Infos
this._glVersion = this._gl.getParameter(this._gl.VERSION);
const rendererInfo: any = this._gl.getExtension("WEBGL_debug_renderer_info");
if (rendererInfo != null) {
this._glRenderer = this._gl.getParameter(rendererInfo.UNMASKED_RENDERER_WEBGL);
this._glVendor = this._gl.getParameter(rendererInfo.UNMASKED_VENDOR_WEBGL);
}
if (!this._glVendor) {
this._glVendor = "Unknown vendor";
}
if (!this._glRenderer) {
this._glRenderer = "Unknown renderer";
}
Since it is deprecated, there must be a new API to replace it. @sebavan - do you know of anything about this deprecation?
sebavan
January 24, 2022, 2:05pm
#3
Just added a safer fallback Firefox Deprecation Warning by sebavan · Pull Request #11831 · BabylonJS/Babylon.js · GitHub
But I wonder how to avoid the warning without UA sniffing, @RaananW ??? the new API will only provide a lame description on Chromium based browsers even Canary.
RaananW
January 24, 2022, 2:54pm
#4
Seems like to avoid that you will need to use it, get the vendor name, and if it’s firefox, don’t use it!
Wait…
Gosh, I hate UA sniffing. I would simply live with the deprecation note, making sure we fallback correctly once it is not available anymore
sebavan
January 24, 2022, 2:58pm
#5
Yup basically what is in the PR as I came to the same conclusion.
1 Like