LWJGL with OpenGL ES 2

Started by frostybeard, April 22, 2011, 10:22:16

Previous topic - Next topic

frostybeard

Does anyone know how to get LWJGL to use OpenGL ES 2 instead of OpenGL 2?
I have an OMAP4 based computer (Panda Board). It has powerful OpenGL ES 2
graphics accleration, but no acceleration for vanilla OpenGL 2.

I think it would also open up a lot of possibilities in the mobile device world to
have an Open GL ES 2 based LWJGL.

spasi

I've been meaning to add support for ES 2.0 for a few months now, but didn't have the free time to do it yet. The code is ready (EGL, GL ES 2.0 + extensions), just need to merge it with the current codebase and clean it up a bit. In any case, don't expect a non-x86 build from LWJGL. You'll have to checkout the project and cross-compile it for ARM on your own.

frostybeard

It already is there for ARM. It is at least in the Ubuntu 10.10 sources for ARMEL. The main problem
is that it doesn't find the graphics acceleration.
Apparently you don't have to do much to be able to support ARM.

But there wouldn't be much point in adding Open GL ES 2.0 support without supporting ARM, I think.
I don't know of any X86 systems that use Open GL ES 2.0, but NVidia Tegra, OMAP3, OMAP4,
Snapdragon, etc. all use OpenGL ES. They are all ARM. In some applications they are used
almost like a PC.

Matzon

Quote from: spasi on April 22, 2011, 15:06:50
I've been meaning to add support for ES 2.0 for a few months now, but didn't have the free time to do it yet. The code is ready (EGL, GL ES 2.0 + extensions), just need to merge it with the current codebase and clean it up a bit. In any case, don't expect a non-x86 build from LWJGL. You'll have to checkout the project and cross-compile it for ARM on your own.
How will we maintain it down the road if we dont have some devices to test it regularly on? and do test builds?

spasi

That's my point, we can't have true support for the time being.

I have this implementation lying around, it has been tested extensively for many months and I had it running on a high-end ARM-based device. The code works and it is indeed very easy to cross-compile to ARM, assuming you have a proper toolchain available. Now, that project has been cancelled and I got permission to use the code in LWJGL and that's all I can offer atm. I don't have access to the hardware or toolchain anymore, so in the best case I can do tests on x86 using a desktop ES emulator.

I'm hoping that someone else will jump in and properly maintain this, with access to hardware, etc. I'm not sure how easy it's going to be to produce an ARM build that works on more than one device out there (don't forget about audio/input too). The toolchains are constantly being updated, we're going to have Windows on ARM soon, it's going to be a lot of work (and testing). Anyway, I'm guessing that people that genuinely want to deploy applications using LWJGL ES will want to build on their own (e.g. to add support for custom input controls for their target device).

So, I'll try to incorporate my code in a way that allows someone to easily build this for ARM and also make sure that it doesn't interfere with the rest of LWJGL. Sounds good?

frostybeard

I can test it in Ubuntu 10.10 on the Panda Board. Do you have a test applet that you use for testing?

Matzon


spasi

No need for a patch, OpenCL should just worktm anywhere, as long as there's a driver available in the execution environment. :)

frostybeard

I can also test it on Tegra 2 in the near future. I also have a Nokia N900 (OMAP3), but I couldn't find a jre in its repositories, so I have to either compile it or find it.

I can test it immediately. Just post here if you'd like to contact me.

spasi

OK, I'll post in this thread when I commit the code. Will take a while as I'm quite busy these days.

frostybeard

Spasi, do you want help merging your implementation?

spasi

Nah, I just haven't had the time yet. I've been extremely busy lately; we're about to do a massive update to our online system and we were also affected by the Amazon disaster, so I haven't slept properly for about 3 weeks as you can imagine. It should cool down next week, I'll update this thread once I've made some progress.

spasi

I've started working on this. The biggest problem atm is that the implementation I have assumed 32bit memory space, so I'll have to port everything to use longs for proper integration with LWJGL. Looks relatively clean so far, EGL, GLES20 and all extensions have been merged without serious issues. I've made a new package for now (org.lwjgl.opengles) but I'm not sure if I'll manage to keep it this way, I may have to put some stuff in .opengl for package-private access.

I'll keep you posted on further progress.

Matzon

depending on the visibility of you work, you could consider creating a branch in the svn.

spasi

Most of the code is in place now. Next step is fixing the native code (mostly removing WGL/GLX stuff), will take a while, our window/context management implementation isn't exactly clean. Good news is that the desktop version is compiling properly now. Hopefully everything will work exactly like they are now in the trunk (both API and build-wise) and we'll have a couple extra targets for ES (e.g. "jars_es" and "compile_native_es") that will generate a separate build for OpenGL ES specifically.