Hi All,
I found a problem on a Win Vista running Chrome 49 on a very old Toshiba Laptop (7-8 years old).
Modernizr.webgl was returning true, but three.js was not able to initialize the webgl context, so I had to add another extra check using the raccomanded initialization check by Khronos group (https://www.khronos.org/webgl/wiki/FAQ).
As stated in the FAQ:
If the browser supports WebGL and canvas.getContext("webgl") returns null then WebGL failed for some reason other than user's browser (no GPU, out of memory, etc...)
So, it seems that the actual test in Modernizr is just checking for the browser support (which is true in Chrome 49), but for a more 'real' test, is needed to try to initialize the context via getContext.
Can this be considered a bug in Modernizr or it's the expected behavior?
Many three.js examples uses the following entity to detect WebGL support: Detector.
AFIAK you need to create a context object via getContext and check the result to be sure about WebGL support. It looks like the current WebGL feature detect of Modernizr doesn't do this...
Yeah, its an unfortunate balancing act. There is a TON of work the browser has to do in order to make a webgl context, and it can cause a bunch of bad prerf side effects. The existing method strikes the best balance between accuracy and performance that we have found, and folks that need more granular support like yourself are probably best served by making a test context and checking like the Khronos group suggests
Sorry :[
Most helpful comment
Yeah, its an unfortunate balancing act. There is a TON of work the browser has to do in order to make a webgl context, and it can cause a bunch of bad prerf side effects. The existing method strikes the best balance between accuracy and performance that we have found, and folks that need more granular support like yourself are probably best served by making a test context and checking like the Khronos group suggests
Sorry :[