Cannot read property 'getParameter' of undefined [GLES3 doesn't run on HTML5 but GLES2 does]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By TheConceptBoy

Good day.

I’m running a test using a web server (Uniform Server). I cannot get the game to run on GLES3. GLES2 works fine but you get the GLES2 limiations with it using WebGL 1.0. I’d really like to use GLES3 with WebGL 2.0.

I get the:

Cannot read property 'getParameter' of undefined

What is the cause of this issue? I’m testing on Chrome, Firefox and Opera

This is the console log error from the browser.

   index.js:7 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
    RuntimeEnvironment.ASM_CONSTS @ index.js:7
    index.js:7 exception thrown: TypeError: Cannot read property 'getParameter' of undefined,TypeError: Cannot read property 'getParameter' of undefined
        at _glGetString (http://localhost/index.js:7:264742)
        at __ZN15RasterizerGLES310initializeEv (wasm-function[41579]:0x7edb20)
        at __ZN18VisualServerRaster4initEv (wasm-function[40145]:0x77b45f)
        at __ZN13OS_JavaScript10initializeERKN2OS9VideoModeEii (wasm-function[42562]:0x839430)
        at __ZN4Main6setup2Ey (wasm-function[36467]:0x65dc2a)
        at __ZN4Main5setupEPKciPPcb (wasm-function[36469]:0x662d53)
        at _main (wasm-function[19712]:0x40336e)
        at Object.RuntimeEnvironment.Module._main (http://localhost/index.js:7:316091)
        at Object.callMain (http://localhost/index.js:7:319807)
        at Engine.synchronousStart (http://localhost/index.js:216:15)
    callMain @ index.js:7
    (index):241 Cannot read property 'getParameter' of undefined
    displayFailureNotice @ (index):241
    index.js:7 **ERROR**: Condition ' !_start_success ' is true. returned: false
    put_char @ index.js:7
    index.js:7    At: main/main.cpp:1278:start() - Condition ' !_start_success ' is true. returned: false
    put_char @ index.js:7
    index.js:7 78
    index.js:7 78
    abort @ index.js:7
    index.js:7 Uncaught abort(78). Build with -s ASSERTIONS=1 for more info.
    index.js:7 101
    index.js:7 101
    abort @ index.js:7
    index.js:7 Uncaught abort(101). Build with -s ASSERTIONS=1 for more info.
    index.js:7 101
    index.js:7 101
    abort @ index.js:7
    index.js:7 Uncaught abort(101). Build with -s ASSERTIONS=1 for more info.
    index.js:7 101
    index.js:7 101
    abort @ index.js:7
    index.js:7 Uncaught abort(101). Build with -s ASSERTIONS=1 for more info.
    index.js:7 101
    index.js:7 101
    abort @ index.js:7
    index.js:7 Uncaught abort(101). Build with -s ASSERTIONS=1 for more info.

TheConceptBoy | 2019-10-23 23:10

:bust_in_silhouette: Reply From: wombatstampede

As you can read here:

… GLES3 is mapped to WebGL2 and its use is not recommended. One reason is that Safari and Edge don’t support it. Which browser did you use for testing?

So I propose that you stick with GLES2 → WebGL1 when you want to target HTML.

Thanks for replying.
As mentioned in my original post. Tested on Chrome, Opera and Firefox.

To be honest I actually don’t really care about support for Safari and Edge for the time being. It still doesn’t work in the above mentioned browsers.

I’ve read that question too, it’s was confusing that WebGl2 is implemented into godot, however it does not work… anywhere… my question is what’s the point of having it be implemented in the first place if it doesn’t work? Or is it something that’s just there for testing and benchmarks and it’s going to be properly implemented somewhere down the roadmap?

Thanks.

TheConceptBoy | 2019-10-24 16:43

Then it is only Opera that is incompatible (as it is based on Webkit like Safari).

I can just guess that it was implemented together with introducing GLES3 for Godot 3. But later given up because to many problems arose and WebGL2 will anyway be removed from Godot 4 because OpenGL3 will be replaced by Vulkan.

I propose that you create your project in OpenGL2/WebGL1 (if you decide to continue to use Godot) and then move up to the Vulkan based browser support when it gets available some time after Godot 4 is released.
WebGPU - Wikipedia

Although there’s no fixed date for Godot 4 release and especially not for some WebGPU Export template.

That aside, Godot is open source. If you don’t want to miss WebGL2 then you could debug & update that Godot export template yourself and contribute it to the community.

wombatstampede | 2019-10-25 07:26