Page 1 of 1

Browser widget does not suppüort WebGL2

Posted: Sun Aug 16, 2020 12:33 pm
by TorstenHolmer
Hi,

I want to test how to display a WebGL-Page in the browser widget, but get this message on this page (https://get.webgl.org/webgl2/) :

"Oh no! We are sorry, but your browser does not seem to support WebGL2."

Is there a way to update the widget?

Chrome does support WebGL 2.0

Cheers,
Torsten

Re: Browser widget does not suppüort WebGL2

Posted: Sun Aug 16, 2020 12:43 pm
by Klaus
Hi Torsten,

I also get this message on my Mac 10.14.6 with the latest Safari 13.1.2!

Since the browser widget uses the underlying OS web engine (at least on the Mac = Webkit, no idea about Win and Linux)
there is no way to "update" the widget.


Best

Klaus

Re: Browser widget does not suppüort WebGL2

Posted: Mon Aug 17, 2020 5:03 pm
by TorstenHolmer
Hi Klaus,

the problem with Safari in macOS is that WebGL is off by default, but can be activated via developer mode:
German version: Menü / Entwickler / Experimentelle Funktionen / WebGL 2.0
Then it works!

I have found this discussion about how to enable WebGL in macOS apps:
https://stackoverflow.com/questions/136 ... -on-webkit

The solution is the following:
You need to set the user preference WebKitWebGLEnabled to @YES for your app. To have the setting apply the first time the app is run, it needs to be set early, before the WebView is initialized. In my case, the WebView instance is loaded from the main nib file, so that's very early indeed. I added this code to Supporting Files/main.m:

[[NSUserDefaults standardUserDefaults] setObject:@YES
forKey:@"WebKitWebGLEnabled"];
So, there is a way for Objective C apps in macOS to enable WebGL for the WebView component. Therefore it should be possible to enable this in the Livecode browser, too?

Cheers,
Torsten

Re: Browser widget does not suppüort WebGL2

Posted: Fri Oct 09, 2020 4:17 pm
by sandrino68
I've created two small stacks to test for WebGL and WebGL2

As you can see, the basic WebGL v1 works perfectly

It would be great if the LiveCode team were to fix this !

We could build a great bindings API to manipulate 3D scene graph canvases directly from LiveCode script !

Re: Browser widget does not suppüort WebGL2

Posted: Sun Nov 01, 2020 2:38 pm
by Monox18
I can confirm it works in LC 9.6.1 for Windows. I opened https://get.webgl.org/webgl2/ in a browser object in a new stack. Got this result:

Image

Now, what I'm worried about is Klaus response. How so the browser widget uses the underlying OS browser? I thought that when creating a standalone application, the 148MB CEF in externals folder was the browser used by the widget. When running https://html5test.com/ on my chrome I get 528/555, but running it in IDE browser I get 525/555 (including WebGl1 and 2). That makes me believe they are indeed different browsers.

I haven't tested in mobile, but I plan to deploy later for mobile. So I'm really hoping the same compiled browser is used across all OS for consistency and not the OS browser.

Re: Browser widget does not suppüort WebGL2

Posted: Sun Nov 01, 2020 3:07 pm
by Klaus
On the Mac LC definitively uses WebKit, the underlying macOS web engine!
No CEF or whatever in the Mac installation!

As I wrote, this may be different on Win and Linux, no idea about mobile.

Re: Browser widget does not suppüort WebGL2

Posted: Sun Nov 01, 2020 7:12 pm
by mwieder
On linux the browser widget (which is built on CEF) doesn't work anyway, so the question is moot there.
But chrome on linux mint scores 525/555 on the html test, and shows support for WebGL2.

Re: Browser widget does not suppüort WebGL2

Posted: Sun Nov 01, 2020 8:46 pm
by wsamples
On Arch Linux / Plasma the browser widget functions and shows it does support WebGL2, according to the test page.

Re: Browser widget does not suppüort WebGL2

Posted: Sun Nov 01, 2020 10:09 pm
by mwieder
Ooooo... interesting. I wonder what's different about Arch CEF support.

Re: Browser widget does not suppüort WebGL2

Posted: Sun Nov 01, 2020 10:12 pm
by FourthWorld
Warren, do you have any tips on how to make the browser widget work on Debian-based distros?

Re: Browser widget does not suppüort WebGL2

Posted: Mon Nov 02, 2020 6:01 am
by wsamples
Sorry, Richard, I don't have any helpful advice. The IDE itself behaves differently in Arch depending on which DE you run but I haven't really looked into this specifically regarding the browser widget. I might now, just for fun, but even then I could only report my experience. I don't have any of the deep understanding of how these things work that you and Mark have. Linux is such a cobbled together affair and each DE on any distro will have some different major parts and I have a suspicion that it's a more complex question of which window manager and compositor you're running and how they get along with LC and how it manages GUI elements than it just bluntly which distro it is.

Re: Browser widget does not suppüort WebGL2

Posted: Mon Nov 02, 2020 8:31 am
by mwieder
Heh. Not gonna claim any deep understanding here.
I can verify that there's no problem with the CEF libraries on linux mint because I can compile and run the test programs with no problem.
I started down the path of looking into the way the engine uses the CEF libraries, but Mark Waddingham dissuaded me from following up on that, saying that CEF itself isn't the problem (although they're dropped it for OSX) but rather the way it's integrated into the engine. And that it would need to be fixed up in the "right" way.

Re: Browser widget does not suppüort WebGL2

Posted: Mon Nov 02, 2020 10:57 am
by LCMark
@mwieder : From what I can find, what I last said on the topic was:
CEFSimple works - yes - but IIRC CEFSimple is 'you embed what you want to do in CEF' - LC has to do the opposite - we embed CEF in LC and for some reason something screws that up in 'recent' Linux releases and we are not sure what unfortunately (despite a good deal of time having been burnt on trying to figure out why in the past).

FWIW, CEF only really exists in a usable form (from what I can see) because there are some rather large companies which use it to build their clients - in particular Spotify and Steam (I think at least, they may have moved to some other means - I don't know). It used to sponsored heavily by Adobe as (I think) it used to be what they used to provide some sort of Flash standalone type thing. Spotify took over the main sponsorship of it (e.g. providing build servers and well managed releases) a year or two ago. All three of those companies embedded stuff in CEF, so the ability to embed CEF in something else whilst present perhaps doesn't get as much love as would be ideal.

For example, we had to drop using CEF on macOS quite a while back because the port of it there was using NSAutoreleasePools incorrectly *unless* CEF was the master (i.e. being extended, rather than being embedded), this would cause random crashes (earlier versions of macOS seemed to tolerate the abuse okay, but in later versions it caused a lot of instability).
I don't think has anything 'dissuading' about it :)

I was merely trying to explain that the CEF samples (and most uses of CEF) use CEF 'the other way round' from the engine - so whilst the fact they work is good to know, it doesn't really help that much.

The key thing is finding out why the CEF worker process(es) hang after being initialized which (if I recall correctly) is the crux of the problem.

Re: Browser widget does not suppüort WebGL2

Posted: Mon Nov 02, 2020 4:47 pm
by mwieder
Well, I think I'm happy to stand corrected, and while I don't think this is the proper forum for it...

My impression before was that CEF support in the engine wasn't long for this world, especially given lack of other industry support, and therefore trying to "fix" it was a waste of time. Is that not true and worth pursuing further? I stopped looking after that discussion. It's definitely the separate CEF process that's the zombie, as I have to go and kill it explicitly afterwards.