FreeBasic+Emscripten+OpenB3D: sky is the limit

For other topics related to the FreeBASIC project or its community.
angros47
Posts: 1821
Joined: Jun 21, 2005 19:04

FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby angros47 » Nov 29, 2020 21:11

Here is a simple demo. It will remain online for a limited time, unless I can find a better hosting.

https://airplane.tiiny.site/

It's my simple demo, that I made years ago for OpenB3D, compiled for the web with no changes at all to the basic source
JohnK_RQ
Posts: 21
Joined: Nov 25, 2019 1:50

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby JohnK_RQ » Nov 30, 2020 2:33

I like the idea but after a few seconds
I get an "exception error, see javascript console"
I can't open the console and nothing appears in the rendered console.
Good luck!
paul doe
Posts: 1367
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby paul doe » Nov 30, 2020 2:39

@angros47: I'm also having troubles with it. It just stays there, 'downloading...'
My IC is very slow, though...
VANYA
Posts: 1465
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby VANYA » Nov 30, 2020 6:50

Everything works fine. It takes more than 10 seconds to load on the PC. On a simple tablet (android), it loads more than 40 seconds and fps is low, but there are no sharp brakes.

It will remain online for a limited time, unless I can find a better hosting


For such simple pages, you can try use the sf.net hosting, here is example of one of the pages.
angros47
Posts: 1821
Joined: Jun 21, 2005 19:04

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby angros47 » Nov 30, 2020 10:01

@JohnK_RQ and @paul doe

Which browser are you using? The demo uses WebGL and WebAssembly, so if the browser doesn't support them it won't work. Can you use other WebGL examples from the web?

I tested it mainly on FireFox, under Ubuntu Linux (I also ran a little test on Chrome on Android) Anyone who tried it could provide a feedback? I'd like to know browser, operating system, processor (32bit or 64 bit) and if it works or not.
paul doe
Posts: 1367
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby paul doe » Nov 30, 2020 11:00

angros47 wrote:...
Which browser are you using? The demo uses WebGL and WebAssembly, so if the browser doesn't support them it won't work. Can you use other WebGL examples from the web?

I tested it mainly on FireFox, under Ubuntu Linux (I also ran a little test on Chrome on Android) Anyone who tried it could provide a feedback? I'd like to know browser, operating system, processor (32bit or 64 bit) and if it works or not.

Firefox, Win10 64-bits, Intel Celeron N 2830 2@2.14, with a low-end integrated GPU. I can't tell if it works or not, since it just stays there downloading. Perhaps I should wait a little longer? (I waited like 10 min before aborting)

And yes, I can use other sites with WebGL and/or WebAssembly.
angros47
Posts: 1821
Joined: Jun 21, 2005 19:04

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby angros47 » Nov 30, 2020 16:11

That should work, in theory. Also, if it didn't work, it should return an exception, not keep loading. It makes me thing that it fails to completely load, and perhaps an incomplete file remained in the cache.

Still, the whole game (script, wasm file, and data file) is about 4 Mb, so it shouldn't be too big to download
JohnK_RQ
Posts: 21
Joined: Nov 25, 2019 1:50

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby JohnK_RQ » Nov 30, 2020 22:52

Correct on my Android phone, crashes probably because of webGl is not supported.

On my Win10 Surface laptop, I get variable amount of rendering, then can come up with exception.

Clicking fullscreen always causes exception.
badidea
Posts: 2226
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby badidea » Nov 30, 2020 23:16

Here 'the flying plane over mountains' demo works.
But 'Resize canvas' and 'Lock/hide mouse pointer' don't seem to do anything.
And 'Fullscreen' also triggers a 'Exception thrown, see JavaScript console'.
Bottom-right shows a console that does not do much.

Web-console Firefox:

Code: Select all

wasm streaming compile failed: TypeError: Response has unsupported MIME type airplane.tiiny.site:138:19
    printErr https://airplane.tiiny.site/:138
    instantiateAsync https://airplane.tiiny.site/air.js:1774
falling back to ArrayBuffer instantiation airplane.tiiny.site:138:19
    printErr https://airplane.tiiny.site/:138
    instantiateAsync https://airplane.tiiny.site/air.js:1775
WebGL warning: drawElementsInstanced: Drawing without vertex attrib 0 array enabled forces the browser to do expensive emulation work when running on desktop OpenGL platforms, for example on Mac. It is preferable to always draw with vertex attrib 0 array enabled, by using bindAttribLocation to bind some always-used attribute to location 0. air.js:7371:13
Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S) airplane.tiiny.site:138:19
    printErr https://airplane.tiiny.site/:138
    abort https://airplane.tiiny.site/air.js:1602
    requestFullScreen https://airplane.tiiny.site/air.js:4652
    Module_requestFullScreen https://airplane.tiiny.site/air.js:8496
    onclick https://airplane.tiiny.site/:1
Uncaught Error: undefined air.js:1613:11
    abort https://airplane.tiiny.site/air.js:1613
    requestFullScreen https://airplane.tiiny.site/air.js:4652
    Module_requestFullScreen https://airplane.tiiny.site/air.js:8496
    onclick https://airplane.tiiny.site/:1

Ubuntu Mate 18.04 (64-bit). Firefox 82.0 (64-bit). Similar behavior with Chromium. Hardware: A Dell Latitude E7450 laptop.
paul doe
Posts: 1367
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby paul doe » Dec 01, 2020 0:52

angros47 wrote:...
Still, the whole game (script, wasm file, and data file) is about 4 Mb, so it shouldn't be too big to download

I see. My IC wasn't working stellarly these last days, so as soon as it gets a bit better I'll give it another shot and report back. Thanks.
angros47
Posts: 1821
Joined: Jun 21, 2005 19:04

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby angros47 » Dec 01, 2020 1:09

@BadIdea
Does this other test have the same errors? Or does it work better?

https://airplane2.tiiny.site/
paul doe
Posts: 1367
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby paul doe » Dec 01, 2020 1:51

angros47 wrote:...
Does this other test have the same errors? Or does it work better?

https://airplane2.tiiny.site/

Oh, nice! This one actually works (took a while to load but it finally did):

Image

No (apparent) frame issues, but is water supposed to look like in the picture? (It 'flashes' constantly)
angros47
Posts: 1821
Joined: Jun 21, 2005 19:04

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby angros47 » Dec 01, 2020 10:18

Yes, it is (it flashes because it is too close to the terrain, it does the same in the native version). Unfortunately I realized that the new version doesn't work anymore on my Android... :-(
paul doe
Posts: 1367
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby paul doe » Dec 01, 2020 10:57

Mighty impressive all the same. This is a long time dream materializing, one little step at a time. Well done, angros47 and VANYA! Keep it up!
angros47
Posts: 1821
Joined: Jun 21, 2005 19:04

Re: FreeBasic+Emscripten+OpenB3D: sky is the limit

Postby angros47 » Dec 01, 2020 15:49

Thank you. Please, could you try https://airplane.tiiny.site/ again, and tell me if it works? Because with the new changes, it works again on my phone, too

Return to “Community Discussion”

Who is online

Users browsing this forum: Google [Bot] and 9 guests