Horde3D

Next-Generation Graphics Engine
It is currently 12.10.2024, 14:14

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Horde3D emscripten
PostPosted: 25.08.2018, 04:39 
Offline

Joined: 27.03.2011, 08:40
Posts: 47
Location: Fi
This is a fork of https://github.com/attilaz/horde3d-x/tree/gles2_d3d11 which is based on horde3d beta5. This can be compiled to js/wasm with emscripten.

https://github.com/bosoni/Horde3D_em


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D emscripten
PostPosted: 26.08.2018, 12:05 
Offline

Joined: 17.11.2009, 17:00
Posts: 205
Location: Russia, Moscow
Hello. Good work. I've also worked on emscripten support earlier with ES3 backend that is not yet uploaded. I see that you've made your own framework for samples - it's probably good because current sample framework in v1.0 has problems with pointers to parent classes in emscripten. If you wish I can pull request the current ES3 backend to develop branch so that you can work on the latest code base. The backend still has some problems, but it works with emscripten.


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D emscripten
PostPosted: 13.09.2018, 00:08 
Offline

Joined: 02.04.2013, 16:49
Posts: 36
yes, nice and interesting work there mikel! I'm assuming the skybox/dds loading problem is related to the horde3d-x port?

Image

good job, keep it up!


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D emscripten
PostPosted: 19.09.2018, 17:24 
Offline

Joined: 27.03.2011, 08:40
Posts: 47
Location: Fi
Thanks Irdis and rasteron :)

@Irdis Sure, it would be nice to have horde3d-develop with ES3 backend (ES2 would be nice too but maybe too much work to merge these). Actually horde3d-x and horde3d-emscripten have only few modifications (at core code), it is almost the same.
My little framework (using sdl2) works with develop branch (quicker develop with normal OS and IDE and now and then compile it with emscripten (and add #ifdef's when needed).

@rasteron
"I'm assuming the skybox/dds loading problem is related to the horde3d-x port?"
I'm not sure, havent have time to check, I think it is because of some unavailable extension or so (like shadows, those worked on android but something missing in webgl).
I know dds can be loaded and used too with webgl (babylon.js, three3d.js).
I tested years ago horde3d-x with android but dont remember if I used skymap/reflection.

I havent touched the code quite a while, I'm learning opencv and raspi3 and so, but maybe someday I will once again check these all again.

Cheers :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D emscripten
PostPosted: 02.07.2019, 04:42 
Offline

Joined: 02.04.2013, 16:49
Posts: 36
Just got back and I see the gles2 desktop version works w/o any problems and yes it could be the issue with missing extensions or maybe decompressing dds textures on Android? I just read it somewhere related, but not entirely sure.

In the meantime, perhaps a good workaround would be just a standard skybox shader with 6 separate images in jpg/tga format?


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D emscripten
PostPosted: 04.07.2019, 20:19 
Offline

Joined: 17.11.2009, 17:00
Posts: 205
Location: Russia, Moscow
Horde currently supports ES3 backend in the develop branch. Emscripten is not yet done, but is planned for final 2.0 release. Es3 backend fully supports etc2 and astc compression.


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D emscripten
PostPosted: 05.07.2019, 13:26 
Offline

Joined: 02.04.2013, 16:49
Posts: 36
Irdis wrote:
Horde currently supports ES3 backend in the develop branch. Emscripten is not yet done, but is planned for final 2.0 release. Es3 backend fully supports etc2 and astc compression.


That's good to know. Any chance there will be support for ES2 as well? If there will plans for Android/iOS targets then it would be nice to have this at least to reach more older targets (but not too old). or is it compatible also with ES2 devices?


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D emscripten
PostPosted: 05.07.2019, 16:48 
Offline

Joined: 17.11.2009, 17:00
Posts: 205
Location: Russia, Moscow
Currently I'm adding support for Android and Ios. As for ES2 - practically all devices, even low end, that are released now support es 3.1 or 3.2. Most middle-end devices from 2015 support ES 3.0. WebGL 2 also suggests using ES 3. And using es2 requires a lot of hacks and extensions in order to support common Horde functionality. So, currently I have no plans to support es2 backend.


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D emscripten
PostPosted: 09.07.2019, 01:49 
Offline

Joined: 02.04.2013, 16:49
Posts: 36
Irdis wrote:
Currently I'm adding support for Android and Ios. As for ES2 - practically all devices, even low end, that are released now support es 3.1 or 3.2. Most middle-end devices from 2015 support ES 3.0. WebGL 2 also suggests using ES 3. And using es2 requires a lot of hacks and extensions in order to support common Horde functionality. So, currently I have no plans to support es2 backend.


That's great. Too bad it won't be supported and instead of getting out of topic here in mikel's thread, I would be posting some thoughts re this on a new separate thread. Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: Horde3D emscripten
PostPosted: 18.01.2024, 08:59 
Offline

Joined: 02.01.2017, 02:59
Posts: 24
Thanks for this repo.
It works but the current emcc has a issue with this line:
gRDI->setShaderConst( _defColorShader.uni_worldMat, CONST_FLOAT44, &Matrix4f().x[0] );

/Source/Horde3DEngine/egRenderer.cpp:2009:69: error: cannot take the address of an rvalue of type 'float'

I dont know why, but it doesn't like that way of sending the float array, this worked fine:
gRDI->setShaderConst( _defColorShader.uni_worldMat, CONST_FLOAT44, Matrix4f().x );

And thanks for the makefiles I was wondering how to bypass cmake, I a lot easier!




I spoke too soon, it's missing a few GL functions somewhere.

Anyway its still a good guide to h3d and emscripten.

Code:

warning: undefined symbol: glBlitFramebufferANGLE (referenced by root reference (e.g. compiled C/C++ code))
warning: undefined symbol: glCompressedTexImage3DOES (referenced by root reference (e.g. compiled C/C++ code))
warning: undefined symbol: glFramebufferTexture2DMultisampleEXT (referenced by root reference (e.g. compiled C/C++ code)
)
warning: undefined symbol: glRenderbufferStorageMultisampleANGLE (referenced by root reference (e.g. compiled C/C++ code
))
warning: undefined symbol: glRenderbufferStorageMultisampleEXT (referenced by root reference (e.g. compiled C/C++ code))

warning: undefined symbol: glTexImage3DOES (referenced by root reference (e.g. compiled C/C++ code))
emcc: warning: warnings in JS library compilation [-Wjs-compiler]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group