Wings 3D Development Forum
Wings 3D with OpenGL ES? - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Programming (https://www.wings3d.com/forum/forumdisplay.php?fid=7)
+--- Thread: Wings 3D with OpenGL ES? (/showthread.php?tid=886)



Wings 3D with OpenGL ES? - john doe - 09-22-2014

Hello,

I have a Hardkernel ODROID XU-3 Single Board Computer (SBC), somewhat similar to Raspberry Pi, except more powerfull (more CPU cores, more RAM).

I first attempted to run Blender on it but it turned out that Blender needs OpenGL but the ODROID XU-3 hardware accelerator implements the subset known as OpenGL ES.

I discussed this with others at the ODROID and Blender Artist Community forums:

* http://forum.odroid.com/viewtopic.php?f=99&t=6611
* http://blenderartists.org/forum/showthread.php?349715-Does-Blender-need-OpenGL-or-can-it-run-with-OpenGL-ES

So now I was wondering if you could tell me, can Wings 3D run with OpenGL ES?

If not in current state, how much work do you think it would involve to port Wings 3D to use OpenGL ES?

I attempted to build from source (wings-1.5.3.tar.bz2) anyway to see what happened. I got an error which I suppose might be because my version of Erlang is different?

Code:
(cd intl_tools; make)
make[1]: Entering directory `/home/odroid/wings-1.5.3/intl_tools'
make TYPE=opt common
make[2]: Entering directory `/home/odroid/wings-1.5.3/intl_tools'
erlc  -Werror +debug_info +debug_info -o. tools.erl
make[2]: Leaving directory `/home/odroid/wings-1.5.3/intl_tools'
make[1]: Leaving directory `/home/odroid/wings-1.5.3/intl_tools'
(cd src; make)
make[1]: Entering directory `/home/odroid/wings-1.5.3/src'
make TYPE=opt common
make[2]: Entering directory `/home/odroid/wings-1.5.3/src'
erlc -Werror -I ../e3d +debug_info '-Dwings_version="1.5.3"' -pa ../intl_tools  -o../ebin wings_lang.erl
erlc -Werror -I ../e3d +debug_info '-Dwings_version="1.5.3"' -pa ../intl_tools  -o../ebin user_default.erl
erlc -Werror -I ../e3d +debug_info '-Dwings_version="1.5.3"' -pa ../intl_tools  -o../ebin wings.erl
wings.hrl:171: referring to built-in type queue as a remote type; please take out the module name
wings.hrl:188: referring to built-in type array as a remote type; please take out the module name
wings.hrl:189: referring to built-in type array as a remote type; please take out the module name
wings.hrl:190: referring to built-in type array as a remote type; please take out the module name
wings.hrl:192: referring to built-in type set as a remote type; please take out the module name
wings.hrl:193: referring to built-in type array as a remote type; please take out the module name
wings.hrl:195: referring to built-in type array as a remote type; please take out the module name
make[2]: *** [../ebin/wings.beam] Error 1
make[2]: Leaving directory `/home/odroid/wings-1.5.3/src'
make[1]: *** [opt] Error 2
make[1]: Leaving directory `/home/odroid/wings-1.5.3/src'
make: *** [all] Error 2

I'm using Erlang R16B03 on Ubuntu 14.04, installed with apt-get. Listed by dpkg as version 1:16.b.3-dfs.

I saw the stickied thread about building on Linux now, http://www.wings3d.com/forum/showthread.php?tid=778

I'm going to try that and see how it goes.


RE: Wings 3D with OpenGL ES? - john doe - 09-23-2014

In the steps to build Erlang/OTP,

Code:
./otp_build autoconf

threw some errors. I deleted the directory and extracted anew, skipped this step and did configure without options. Currently waiting for make to finish.


RE: Wings 3D with OpenGL ES? - micheus - 09-23-2014

(09-23-2014, 03:31 PM)john doe Wrote: In the steps to build Erlang/OTP,
Code:
./otp_build autoconf
threw some errors.
Did you checked the instructions to build Erlang as I pointed in the HOWTO link?
Maybe it's related to your autoconf version?
Quote:GNU autoconf of at least version 2.59



RE: Wings 3D with OpenGL ES? - john doe - 09-23-2014

(09-23-2014, 03:38 PM)micheus Wrote:
(09-23-2014, 03:31 PM)john doe Wrote: In the steps to build Erlang/OTP,
Code:
./otp_build autoconf
threw some errors.
Did you checked the instructions to build Erlang as I pointed in the HOWTO link?
Maybe it's related to your autoconf version?
Quote:GNU autoconf of at least version 2.59

It worked without having to run the otp_build step.

Looking at those instructions now, I see why it worked anyway;

>If you are building Erlang/OTP from git you will need to run ./otp_build autoconf to generate the configure scripts.

I built it from the tarball, so that's why it worked without having to do that.

With Erlang/OTP built, I am now at the OpenCL part. I've downloaded the ARM Mali OpenCL SDK from http://malideveloper.arm.com/develop-for-mali/sdks/mali-opencl-sdk/ and am now Sourcery CodeBench Lite from http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/arm-gnu-linux which the Mali OpenCL SDK docs said I'd need. This step will likely take some time for me to understand. I'll post again once I have figured it out or if I get too confused to understand it.

The Sourcery CodeBench Lite I downloaded targets ARM but is for IA32. I don't know if they have an edition for ARM host. Either way, it seems to be not much more than a repackaging of GCC and related tools. I guess I'll have to try and get it working with the GCC that I have.

I was hoping it'd be as simple as this:

Code:
mkdir ~/bin
ln -s $( which g++ ) ~/bin/arm-none-linux-gnueabi-g++
ln -s $( which ar ) ~/bin/arm-none-linux-gnueabi-ar
export PATH=~/bin:$PATH

And that I would then be able to build their OpenCL example code.

But after having run make in the sobel sample directory, I get:

Code:
$ ./sobel
OpenCL error: Unknown error
Retrieving OpenCL platforms failed. common.cpp:233
Failed to create an OpenCL context. sobel.cpp:54

So I'm at a bit of a dead end. I guess I'll head back to the ODROID forums and ask for help there.


RE: Wings 3D with OpenGL ES? - john doe - 09-23-2014

Thread I made on ODROID forums about Mali OpenCL SDK: http://forum.odroid.com/viewtopic.php?f=99&t=6653


RE: Wings 3D with OpenGL ES? - dgud - 09-25-2014

You can skip the OpenCL part, that is optional anyway, you can have the source
and build the erlang files in cl/src so that wings find the needed header files.

But OpenGL ES is more or less OpenGL 3.0 (and later) without the compatibility layer.
I.e. all old functionality now removed from opengl which wings still uses, so this a
major rewrite of wings to get it to work.


RE: Wings 3D with OpenGL ES? - john doe - 09-26-2014

(09-25-2014, 08:06 AM)dgud Wrote: You can skip the OpenCL part, that is optional anyway, you can have the source
and build the erlang files in cl/src so that wings find the needed header files.
Ok, thanks Smile

(09-25-2014, 08:06 AM)dgud Wrote: But OpenGL ES is more or less OpenGL 3.0 (and later) without the compatibility layer.
I.e. all old functionality now removed from opengl which wings still uses, so this a
major rewrite of wings to get it to work.
This will take more time than I expected, then. I haven't done any OpenGL programming before, so it might be out of my league. I still want to give it a shot, though. I guess I'll have to tear into the code and get something really basic, a sort of OpenGL "hello world" from Erlang, working as the first step. I'll keep posting about my progress and problems in this thread if that's ok. It will be a bit off and on, most likely a few days a month for the most part.


RE: Wings 3D with OpenGL ES? - dgud - 09-28-2014

I guess you will need to hack a lot to get it going,
start in erlang src see lib/wx/c_src where the opengl libraries are build.
You will have to #ifdef out a lot of functionality or maybe not.. hmm I might
have been clever when I wrote that part and it works out of the box.

The easiest would be to compile MESA (opengl clone) and get software rendering.
Simple wings stuff should be fast enough.