I recently bought a RP4 and setup java and intelliJ on it and tried to run my existing game code which is very basic and was getting runtime issues because it could not find the native .so file. After digging around I found that LWJGL recently released version 3.2.3 which has finally added support for arm natives. So I edited my gradle file to depend on the new 3.2.3 version and to my surprise it was able to find the library.
My happiness was short lived though because it soon failed with an error because RP4 does not support OpenGL 3.0. It supports OpenGL ES 3.0 but only OpenGL 2.1. I changed to OPENGL 2.0 but I was getting another error which I have not yet debugged.
I then tried to do a hack and modified the RENDER_CONFIGS in LwjglWindow to have OPENGLES3. But I later found that there is a later check for SUPPORTED_RENDERS in LwjglContext which pretty much forces you to the OpenGL implementations.
I know that JME3 for android uses OpenGL ES 3 so I would assume JME3 is compatible.
I would greatly appreciate if anyone can direct me on how to use OpenGL ES on my raspberry pi 4.
Meanwhile I guess Iāll try to figure out why OPENGL2 is not working.
After debugging, it turns out that the error is due to the format DXT1A not being supported. it is a texture compression that apparently is propietary and raspberry pi drivers don-t support it. I tried to follow this post but still didnāt work:
It might be that it is because Iām running OpenGL 2 instead of OpenGL ES 3. but I donāt know. If anyone could also shed some light here I would appreciate it.
That PR looks nice. It seems to be thought for Android though. It is true that the core will have the capabilities, but I am using the jme-desktop dependency since the pi is not exactly a mobile device. The problem is the jme-desktop seems to force OpenGL only. For now I guess Iāll stick to OpenGL 2.0 and see if I can use another uncompressed texture to bypass the S3TC issue.
That is correct. That is similar to what the LWJGL did. They added a build identifier so now they have linux and linux-arm. Plus they separated the architecture in separate jars. So now the natives-windows jar is 64bits only and the natives-windowsx86 jar is 32 bits only. Same for linux 32 and 64. So yeah we would need to add the linux arm platform, not just android-arm.
I was able to override the dependencies and get the right natives, but my program blowed up when I tried to set the renderer to LWJGL-GLES3 but it doesnāt exist :P. I then tried to force the render by adding it to the list of RENDER_CONFIGS but was stopped because I didnāt add it to the list of SUPPORTED_RENDERERS. So I am not sure if adding the platform or not is needed, or just adding the renderer. LWJGL was not complaining, it was JME.
Is there a reason to have the ARM only in the android package and not the desktop package? Same for GL ES only being in the android package? ARM is coming to more than just mobiles now, I think there is no reason for the desktop package to limit to GL only.
I would love to submit a PR but I am not really that familiar with the internals of JME
Just to be clear. The lwjgl3.so was able to be extracted by LWJGL after I overrode the dependencies to LWJGL to 3.2.3. So it appears that it used its own extracto instead of the extractor in the dektop package. Actually, I searched for usages of the extractor in the desktop package and I found none. So I really donāt know what creating a new platform would be for. Sorry if I missed something in the code, as I said Iām new to JME3 internals.
And thanks for the help!
Edit: Small correction. It is not the desktop package that is limiting. it is the jme3-lwjgl3 package. Specifically LwjglContext and LwjglWindow have the supported renderers and render configs Set and Map that donāt allow GL ES. I am not sure if the lwjgl3 package is for desktop only though, since otherwise how would android use GL ES?
JME uses other native libraries besides lwjgl3, including glfw, openal, jinput, and bulletjme.
JMEās NativeLibraryLoader is definitely used to load bulletjme, but perhaps a basic game doesnāt require physics. Iām unclear how the other native libraries are loaded.
Oh, you are right. I was so focused on trying to get the rendering working that I forgot the other parts. And since Iāve not been able to even get that working I hadnāt gotten any other exceptions. Guess compiling on the pi was a more ambitious project than I thought.
hi, have you tried an Android image on your raspberry pi 4. because jme apps runs on raspberry pi 3 and orange pi using android, maybe is not what you wanted but at least you could use jmonkey on your pi
Hi, do you mean installing android instead of raspbian? The whole point was to install intellij and develop my game while Iām far from my windows machine. Installing Android in the pi would defeat this purpose.
Or did you mean to try using the android package and trick it to use GL ES without an actual android activity?
Edit: OMG. I donāt know what I did, but somehow my game is running with S3TC. I guess I just needed a restart or something. I donāt get any exceptions. I havenāt added sound and Iām using Nifty-gui.