Browser widget does not suppüort WebGL2

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
TorstenHolmer
Posts: 57
Joined: Mon Oct 28, 2013 1:23 pm
Location: Dresden, Germany

Browser widget does not suppüort WebGL2

Post by TorstenHolmer » Sun Aug 16, 2020 12:33 pm

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

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Browser widget does not suppüort WebGL2

Post by Klaus » Sun Aug 16, 2020 12:43 pm

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

TorstenHolmer
Posts: 57
Joined: Mon Oct 28, 2013 1:23 pm
Location: Dresden, Germany

Re: Browser widget does not suppüort WebGL2

Post by TorstenHolmer » Mon Aug 17, 2020 5:03 pm

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

sandrino68
Posts: 2
Joined: Sun Jul 09, 2006 8:12 pm

Re: Browser widget does not suppüort WebGL2

Post by sandrino68 » Fri Oct 09, 2020 4:17 pm

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 !
Attachments
WebGL_basic_test.zip
(1.59 KiB) Downloaded 291 times

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Browser widget does not suppüort WebGL2

Post by Monox18 » Sun Nov 01, 2020 2:38 pm

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.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Browser widget does not suppüort WebGL2

Post by Klaus » Sun Nov 01, 2020 3:07 pm

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.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Browser widget does not suppüort WebGL2

Post by mwieder » Sun Nov 01, 2020 7:12 pm

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.

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 262
Joined: Mon May 18, 2009 4:12 am

Re: Browser widget does not suppüort WebGL2

Post by wsamples » Sun Nov 01, 2020 8:46 pm

On Arch Linux / Plasma the browser widget functions and shows it does support WebGL2, according to the test page.
Attachments
browser_widget.png

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Browser widget does not suppüort WebGL2

Post by mwieder » Sun Nov 01, 2020 10:09 pm

Ooooo... interesting. I wonder what's different about Arch CEF support.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Browser widget does not suppüort WebGL2

Post by FourthWorld » Sun Nov 01, 2020 10:12 pm

Warren, do you have any tips on how to make the browser widget work on Debian-based distros?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 262
Joined: Mon May 18, 2009 4:12 am

Re: Browser widget does not suppüort WebGL2

Post by wsamples » Mon Nov 02, 2020 6:01 am

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.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Browser widget does not suppüort WebGL2

Post by mwieder » Mon Nov 02, 2020 8:31 am

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.

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: Browser widget does not suppüort WebGL2

Post by LCMark » Mon Nov 02, 2020 10:57 am

@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.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Browser widget does not suppüort WebGL2

Post by mwieder » Mon Nov 02, 2020 4:47 pm

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.

Post Reply

Return to “Internet”