User avatar
Fidelius
Posts: 438
Joined: Wed Jan 01, 2014 8:40 pm
Location: Germany

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Tue Feb 11, 2014 9:31 am

Thanks for the update, Xranby, and in-turn Sven.

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Mon Mar 10, 2014 9:36 am

krishnak is using JOGL + JMonkeyEngine 3 + his own varnamq3 project interfacing the Varnam Q3 motion sensing remote control to a Java application running on the Raspberry Pi.
http://www.raspberrypi.org/phpBB3/viewt ... 78&t=70638
video: http://youtu.be/CIq9VOu4zbg?t=48s
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Tue Mar 11, 2014 11:16 am

JogAmp 2.1.5 is released http://forum.jogamp.org/2-1-5-Release-td4031829.html
Java OpenGL, OpenCL & OpenAL bindings on many platforms.

This release makes it possible two use multiple GLMediaPlayers in parallel in order to implement easy cross fade for multiple "mp3" audio playback. The GLMediaPlayer uses the system installed libav/libffmpeg for audio and video decoding.
Example src:
http://jogamp.org/git/?p=jogl.git;a=blo ... va;hb=HEAD
Example:

Code: Select all

wget http://jogamp.org/deployment/jogamp-current/archive/jogamp-all-platforms.7z
7z x jogamp-all-platforms.7z
cd jogamp-all-platforms/jar
java -cp joal.jar:jogl-test.jar:gluegen-rt.jar:jogl-all.jar com.jogamp.opengl.test.junit.jogl.demos.es2.av.CrossFadePlayer a.mp3 b.ogg c.mp4
This release also improve Java OpenCL use on low memory systems, good to have if the Pi gets OpenCL drivers.

The 2.1.5 JogAmp release is tested using Rasbian, it is designed to work on both armel and armhf raspberry pi systems.

If you have issues using the jars please verify that the jars you have downloaded is intact.
We have noticed that some web - browsers especially firefox "wraps" downloaded jars inside zip files that makes the jars unusable. I recommend you to download the 7zip compressed http://jogamp.org/deployment/jogamp-cur ... atforms.7z and unpack it using 7z x jogamp-all-platforms.7z . By doing so you will be sure to use a correctly downloaded build. You get 7z by installing the p7zip-full Raspbian package.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Mon Jun 15, 2015 10:58 am

I noticed an issue using the Raspberry Pi broadcom specific dispmanx API
While working on the RPi libgdx game development framework.
The "dispmanx" mousepointer overlay is misaligned with the OpenGL ES dispmanx window when using the closed source Broadcom BCM driver.
Last edited by xranby on Thu Aug 13, 2015 1:07 am, edited 4 times in total.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Mon Jun 15, 2015 11:10 am

JogAmp 2.3.0 and 2.3.1 is released http://forum.jogamp.org/2-3-0-Release-td4034141.html
2.3.0 changes: http://jogamp.org/wiki/index.php/SW_Tra ... ease_2.3.0
2.3.1 changes: http://jogamp.org/wiki/index.php/SW_Tra ... ease_2.3.1

2.3.1 Download link: http://jogamp.org/deployment/jogamp-cur ... atforms.7z

JogAmp provide Java OpenGL, OpenCL & OpenAL bindings on many platforms.
Notable improvemens seen using 2.3.x are:
- JOGL: Bug 682
Relocating remaining javax.media.opengl.* -> com.jogamp.opengl.*
to relax probable license issue while bundling JOGL
https://jogamp.org/bugzilla/show_bug.cgi?id=682

- GlueGen Bug 1134: Enhancements for Bug 1135
https://jogamp.org/bugzilla/show_bug.cgi?id=1134

This GlueGen enhancement renders it more than capable
to add bindings for other projects!

Should be ready to test w/ Vulkan .. if available

- JOGL: Bug 1135: EGL 1.5, ES 3.1, GL 4.4 + 4.5, misc..
https://jogamp.org/bugzilla/show_bug.cgi?id=1135

- JOGL: Bug 1068: GLContext w/o default framebuffer
https://jogamp.org/bugzilla/show_bug.cgi?id=1068>

The 2.3.1 JogAmp release is tested using Rasbian, it is designed to work on both armel and armhf raspberry pi systems.

If you have issues using the jars please verify that the jars you have downloaded is intact.
We have noticed that some web - browsers especially firefox "wraps" downloaded jars inside zip files that makes the jars unusable. I recommend you to download the 7zip compressed http://jogamp.org/deployment/jogamp-cur ... atforms.7z and unpack it using 7z x jogamp-all-platforms.7z . By doing so you will be sure to use a correctly downloaded build. You get 7z by installing the p7zip-full Raspbian package.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 13, 2015 12:20 am

xranby wrote:I noticed an issue using the Raspberry Pi broadcom specific dispmanx API
While working on the RPi libgdx game development framework.
The "dispmanx" mousepointer overlay is misaligned with the OpenGL ES dispmanx window when using the closed source Broadcom BCM driver.
This issue have now been fixed we have prepared a release candidate test build
RC Test Build 2.3.2-rc-20150812

For raspberry pi users this 2.3.2-rc includes
* fix for misalinged "dispmanx" mousepointer
* can use the xorg as input for GLWindows, it works like minecraft pi rendering opengl into an overlay on top of an xorg window.
* works with Eric Anholts new mesa3d glamour vc4 OpenGL 2 driver
* the release includes a single "fat-jar" that includes all the jogamp modules and natives for all the platforms we support, thus most users only need to download this single jar to get started
http://jogamp.org/deployment/archive/ma ... mp-fat.jar

Example you can use this jogamp jar to probe all opengl capabilities on your system by running the main method of the GLWindow

Code: Select all

java -cp jogamp-fat.jar com.jogamp.newt.opengl.GLWindow
Sources for use by IDE's are also available as a single src.zip
http://jogamp.org/deployment/archive/ma ... va-src.zip

release objectives to fix before the final 2.3.2 release:
https://jogamp.org/wiki/index.php/SW_Tr ... ease_2.3.2

the complete test release is available at
http://jogamp.org/deployment/archive/ma ... 71-signed/

documentation:
http://jogamp.org/deployment/archive/ma ... 1/javadoc/

happy testing!
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
avatar1337
Posts: 78
Joined: Sun Jan 27, 2013 3:14 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Wed Aug 26, 2015 6:27 pm

Hello, I have two problems with JOGL on RPi. When I display a textured quad as a background in JOGL, fullscreen, on my computer in Windows it works perfectly fine, but when I use the same code, even the same compiled class files on RPi the quad doesn't cover the entire display. I know the code is correct because it works fine in Windows. This must be an issue of JOGL. This is how it looks on RPi Image
As I said, the BG image will cover the entire screen in Windows.

The second issue seems to occur when I upgrade to the latest version of JOGL. All my javax includes are reported missing. Is it no longer supported? I had to downgrade again. Thanks.
The creator of the Raspberry Pi Configuration Manager (PiCon)

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 27, 2015 8:18 am

avatar1337 wrote:Hello, I have two problems with JOGL on RPi. When I display a textured quad as a background in JOGL, fullscreen, on my computer in Windows it works perfectly fine, but when I use the same code, even the same compiled class files on RPi the quad doesn't cover the entire display. I know the code is correct because it works fine in Windows. This must be an issue of JOGL. This is how it looks on RPi Image
As I said, the BG image will cover the entire screen in Windows.
This has likely been fixed using the above mentioned 2.3.2 release candidate, it includes this fix:
https://jogamp.org/bugzilla/show_bug.cgi?id=1176 - Misaligned Mousepointer and Window when using NEWT BCM VC IV on Raspberry Pi
avatar1337 wrote: The second issue seems to occur when I upgrade to the latest version of JOGL. All my javax includes are reported missing. Is it no longer supported? I had to downgrade again. Thanks.
We had to stop using the javax. namespace due to a potential licence violation when using jogl in combination with oracles jre.
Oracles jre end user license agreement prevents you to add classes under the javax. namespace.
Also the latest Android SDK prevents you to build projects that include classes under javax likely due to the same reason.

Starting with jogl 2.3.x and later you will find that all
javax.media.opengl.* has been moved to com.jogamp.opengl.*

For more information see: https://jogamp.org/bugzilla/show_bug.cgi?id=682
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
avatar1337
Posts: 78
Joined: Sun Jan 27, 2013 3:14 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 27, 2015 8:38 am

I see thanks. Is it possible to develop a game in JOGL in Windows and then deploy it on Android without using any native code?
The creator of the Raspberry Pi Configuration Manager (PiCon)

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 27, 2015 8:57 am

avatar1337 wrote:I see thanks. Is it possible to develop a game in JOGL in Windows and then deploy it on Android without using any native code?
Yes, jogamp provide all the native code required to get it working.

CCT International have used the JOGL Android binding since its inception in 2011 to allow them to use the C3D Visual Project Control applications rendering engine on both desktop and inside their mobile C3D mobile app. This app allow engineers to visualize and verify construction CAD drawings at the build site.
https://jogamp.org/doc/siggraph2011/jog ... ph2011.pdf - First presentation of the Android binding.
https://www.youtube.com/watch?v=X3Id2VG ... e&t=53m20s - Demo of C3D at Siggraph 2013

Another example; in 2013 the board game company Days of Wonder used JOGL to allow them to use the same code to run their board game Ticket To Ride on Windows, MacOSX, Linux and Android tablets.
https://www.youtube.com/watch?v=X3Id2VG ... .be&t=1135

It also work on android "watches"
https://www.youtube.com/watch?v=Ongvzg5kfhs

The same game will also work on Raspberry Pi
Image
Last edited by xranby on Thu Aug 27, 2015 10:24 am, edited 8 times in total.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
avatar1337
Posts: 78
Joined: Sun Jan 27, 2013 3:14 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 27, 2015 8:58 am

cool =)
The creator of the Raspberry Pi Configuration Manager (PiCon)

User avatar
avatar1337
Posts: 78
Joined: Sun Jan 27, 2013 3:14 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 27, 2015 11:33 am

Okay cool but I tested the fat jar and the problem maintains. I'm not sure what I could do wrong. I might have found another bug. :/

Code: Select all

I'm using glOrtho(-aspect, aspect, -1, 1, -1, 1);
and

Code: Select all

background = ImmModeSink.createFixed(  40, 
        3, GL.GL_FLOAT, // vertex
        0, GL.GL_FLOAT, // color
        0, GL.GL_FLOAT, // normal
        3, GL.GL_FLOAT, // texCoords 
        GL.GL_STATIC_DRAW);

Code: Select all

    private void drawBackground(GL2ES1 gl) {
        background.glBegin(ImmModeSink.GL_QUADS);
                      
        background.glTexCoord2f(0.0f,  1.0f);
        background.glVertex3f(-aspect,  1.0f, 0f);
        
        background.glTexCoord2f(0.0f,  0.0f);
        background.glVertex3f(-aspect, -1.0f, 0f);
        
        background.glTexCoord2f(1.0f,  0.0f);
        background.glVertex3f( aspect, -1.0f, 0f);
        
        background.glTexCoord2f(1.0f,  1.0f);
        background.glVertex3f( aspect,  1.0f, 0f);            
        
        background.glEnd(gl, false);
    }
The creator of the Raspberry Pi Configuration Manager (PiCon)

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 27, 2015 1:23 pm

Instead of posting snippets can you please post your complete source tree to a git repository. I would like to build and test your project on various devices using exactly same data files and source-code.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
avatar1337
Posts: 78
Joined: Sun Jan 27, 2013 3:14 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 27, 2015 1:27 pm

xranby wrote:Instead of posting snippets can you please post your complete source tree to a git repository. I would like to build and test your project on various devices using exactly same data files and source-code.
I will have to create a new project that contains only the relevant code in that case. I will get back to you.
The creator of the Raspberry Pi Configuration Manager (PiCon)

User avatar
avatar1337
Posts: 78
Joined: Sun Jan 27, 2013 3:14 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 27, 2015 2:06 pm

Here I put together a small project with the same issue.
https://github.com/avatar1337/MultisampleDemoES1

here is the background but you can try any texture, it is the same for all:
https://dl.dropboxusercontent.com/u/4969127/bg.png
The creator of the Raspberry Pi Configuration Manager (PiCon)

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 27, 2015 3:27 pm

avatar1337 wrote:Here I put together a small project with the same issue.
https://github.com/avatar1337/MultisampleDemoES1

here is the background but you can try any texture, it is the same for all:
https://dl.dropboxusercontent.com/u/4969127/bg.png
Thank you for the demo, i can now explain the issue.
It is actually this texture that cause the problem.

The texture you have linked have a dimension that is a Non Power of Two, "NPOT".
https://www.opengl.org/wiki/NPOT_Texture
Most new desktop OpenGL cards can handle NPOT textures.
However OpenGL ES 1 driver that is used on the Raspberry Pi can only handle Power of Two "POT" textures,
what happens is that the OpenGL ES 1 driver will add extra black around the texture so that it matches the next larger power of 2 in width and height.

to summarize, in order to make textures render correctly on the Pi using the OpenGL ES 1 driver you need to use dimensions that match one of the following:
1x1 2x2 4x4 8x8 16x16 32x32 64x64 128x128 256x256 512x512 1024x1024 2048x2048 ... and so on.

The Pi will use OpenGL ES 1 that have this POT limitation as long as you request the fixed function GL2ES1 profile.

If you make your code compatible with OpenGL ES 2 then you may use NPOT textures by requesting a GL2ES2 profile.
OpenGL ES 2 on the Pi support the GL_OES_texture_npot extension
https://www.khronos.org/registry/gles/e ... e_npot.txt
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
avatar1337
Posts: 78
Joined: Sun Jan 27, 2013 3:14 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Aug 27, 2015 5:27 pm

Aha I had totally forgot about that. Thanks, now it works fine. =)
The creator of the Raspberry Pi Configuration Manager (PiCon)

gmseed
Posts: 35
Joined: Sat Aug 29, 2015 7:16 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Wed Sep 16, 2015 2:24 pm

Can't seem to get the junit Gears program to run using the pasted command of " xranby":

Code: Select all

pi@raspberrypi ~/jogamp-all-platforms $ java -cp jar/jogl-all.jar:jar/gluegen-rt.jar:/usr/share/java/junit4.jar:jar/jogl-test.jar \ com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT \ - time 400000 -width 1980 -height 1080 -translucent
Peeking inside the jogl-test.jar with 7z the path to TestGearsES2NEWT all looks fine????

and get at runtime:

Code: Select all

Exception in thread "main" java.lang.NoClassDefFoundError:  com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT
Caused by: java.lang.ClassNotFoundException:  com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class:  com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT. Program will exit.

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Thu Sep 17, 2015 1:41 pm

gmseed wrote:Can't seem to get the junit Gears program to run using the pasted command of " xranby":

Code: Select all

pi@raspberrypi ~/jogamp-all-platforms $ java -cp jar/jogl-all.jar:jar/gluegen-rt.jar:/usr/share/java/junit4.jar:jar/jogl-test.jar \ com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT \ - time 400000 -width 1980 -height 1080 -translucent
Peeking inside the jogl-test.jar with 7z the path to TestGearsES2NEWT all looks fine????
There was a change introduced between v2.1.5 and v2.2.0
https://github.com/JogAmp/gluegen/commi ... d14d30b737
Unit Test: Modularize Semantic Version Test / Fix 'excludes'

Refactor base semjar unit test class into
com.jogamp.junit.util.VersionSemanticsUtil, part of new gluegen-test-util.jar.

The new gluegen-test-util.jar shall be used by all other modules to test versioning.
This change made it mandatory to also add the jar/gluegen-test-util.jar to the classpath when running a one of the jogamp jogl junit tests in combination with what we call the "slim" jar layout.
java did indeed find the TestGearsES2NEWT class however the java class-loader did not find classes that the TestGearsES2NEWT depend on and thats why you saw the exception.

The following command line should work if you have junit4 installed on your system, it is worth mentioning that the purpose of the junit tests are to validate the jogamp releases and are normally automatically run by the jogamp build system. The command below will only run a single test and save a picture what the test image looked like. functional but maybe not that much fun.

Code: Select all

java -cp jar/jogl-all.jar:jar/gluegen-rt.jar:/usr/share/java/junit4.jar:jar/jogl-test.jar:jar/gluegen-test-util.jar com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT -time 400000 -width 1980 -height 1080 -translucent
We have also realized that many people want to test jogamp easier. Starting with jogamp jogl v2.3.2 we provide an all in one jar that include all the jogamp modules Gluegen (the core of jogamp that make all other modules work), JOGL (opengl), JOAL (openal) & JOCL (opencl).
The following commands will download the v2.3.2 pre-release and demonstrate how the "fat" jar work.

Code: Select all

# First we download the jogamp-fat.jar 
wget http://jogamp.org/deployment/archive/master/gluegen_888-joal_614-jogl_1438-jocl_1083-signed/fat/jogamp-fat.jar
# There is a main method in GLWindow that we can run as a quick check
# GLWindow will print the version of jogamp and which OpenGL driver is in use
java -cp jogamp-fat.jar com.jogamp.newt.opengl.GLWindow

#try compile and run a small demo application
mkdir -p demos/es2
wget https://raw.githubusercontent.com/JogAmp/jogl-demos/master/src/demos/es2/RawGL2ES2demo.java -O demos/es2/RawGL2ES2demo.java
javac -cp jogamp-fat.jar:. demos/es2/RawGL2ES2demo.java
java -cp jogamp-fat.jar:. demos/es2/RawGL2ES2demo
The list of items we have to fix before the final 2.3.2 release can be found here: http://jogamp.org/wiki/index.php/SW_Tra ... ease_2.3.2
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

gmseed
Posts: 35
Joined: Sat Aug 29, 2015 7:16 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Fri Sep 18, 2015 12:15 pm

Thanks for your reply.

I now get another runtime exception:

Code: Select all

pi@raspberrypi ~/jogamp-all-platforms $ java -cp jar/jogl-all.jar:jar/gluegen-rt.jar:/usr/share/java/junit4/jar:jar/jogl-test.jar:jar/gluegen-test-util.jar com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT -time 400000 -width 1980 -height 1080 -translucent
position null
size 1980 x 1080
resize null
screen 0
translucent true
forceAlpha -1
undecorated false
atop false
fullscreen false
mouseVisible true
mouseConfined false
pointerIcon false
loops 1
loop shutdown false
forceES2 false
forceES3 false
forceGL3 false
forceGL2 false
swapInterval 1
exclusiveContext false
useAnimator true
sysExitWithin none
mappedBuffers false
Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/runner/JUnitCore
	at com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT.main(TestGearsES2NEWT.java:727)
Caused by: java.lang.ClassNotFoundException: org.junit.runner.JUnitCore
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
	... 1 more

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Fri Sep 18, 2015 12:37 pm

gmseed wrote:Thanks for your reply.

I now get another runtime exception:

Code: Select all

pi@raspberrypi ~/jogamp-all-platforms $ java -cp jar/jogl-all.jar:jar/gluegen-rt.jar:/usr/share/java/junit4/jar:jar/jogl-test.jar:jar/gluegen-test-util.jar com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT -time 400000 -width 1980 -height
...
Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/runner/JUnitCore
	at com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT.main(TestGearsES2NEWT.java:727)

This time you got the exception because a typo in the command line here: /usr/share/java/junit4/jar this should be /usr/share/java/junit4.jar you have replaced a . with an / also you need to have junit4 installed on the system.

we know that installing junit4 on Raspbian pulls in quite a lot of dependencies, therefore we include junit inside the new
jogamp-fat-test.jar that we include with the next jogamp jogl v2.3.2 release ;)
http://jogamp.org/deployment/archive/ma ... t-test.jar
thus you can use this single jogamp-fat-test.jar instead of the three gluegen-test-util.jar + jogl-test.jar + junit4.jar jars.
This single test file also include the junit tests for gluegen, openal and opencl.

Hence every issue you have reported is fixed in the next jogamp release, hopefully to the better.

Most of the issues can be remedied today by using build systems such as maven which will automate common tasks such as specifying jars to use on the command line. All jogamp releases are published to maven central for easy integration into build systems and deployment when you use tools such as maven and gradle. We already provide test builds using maven:
https://jogamp.org/wiki/index.php/Maven ... ptional.29
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

gmseed
Posts: 35
Joined: Sat Aug 29, 2015 7:16 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Fri Sep 18, 2015 9:51 pm

Thanks for spotting the typo. I'd previously installed junit4 as per your original instructions.

It's now working and the red+blue+green gears take over the screen!!

Thanks
Graham

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Mon Oct 12, 2015 12:43 pm

JogAmp JOGL 2.3.2 have been released on 2015-10-10
https://jogamp.org

This release make it easy to use mouse and touch input when you are running JOGL applications from inside xorg.
JOGL will use the xorg input system to make your application behave like an always on top xorg window. OpenGL ES output is rendered into a DispmanX overlay on top of the xorg window.

This release make the mouse pointer accurate when used from text console.

This release make JOGL compatible with Eric Anholts new free software Mesa3D vc4 OpenGL 2 driver!

This release includes the a new "fat" all in one jogamp-fat.jar jar deployment option, this single jar is all you need to add to the java classpath to start using OpenGL from Java on the Pi.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

ishanagi
Posts: 8
Joined: Sat Oct 10, 2015 12:06 pm

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Wed Jan 27, 2016 2:41 pm

Hi,
I wonder if you could help me with getting the basic jogl working on the RPI2, I am struggling to find a starting point that works before trying jme3 or libgdx. Nothing I have tried has worked , so I have now moved to the fat jar you have posted above and am getting the similar errors. If I run:-

Code: Select all

java -cp jogamp-fat.jar:. demos/es2/RawGL2ES2demo
on the RPI 2 I get the following exception:-

Code: Select all

Exception in thread "main" java.lang.RuntimeException: com.jogamp.opengl.GLException: Creation of window surface w/ surface handle failed (1): EGLGraphicsConfiguration[DefaultGraphicsScreen[EGLGraphicsDevice[type .egl, v1.4.0, connection decon, unitID 0, handle 0x1, owner true, NullToolkitLock[obj 0x94e9a4]], idx 0],
	eglConfigHandle 0xc, eglConfigID 0xc,
	requested GLCaps[rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.]],
	chosen    GLCaps[egl cfg 0xc, vid 0x8428: rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 24/0/4, sample-ext default, dbl, mono  , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.], [0x7: GLES1, GLES2, VG]]], EGLSurface[ displayHandle 0x1
, surfaceHandle 0x0
, size 1920x1080
, UOB[ OWNS_SURFACE ]
, EGLGraphicsConfiguration[DefaultGraphicsScreen[EGLGraphicsDevice[type .egl, v1.4.0, connection decon, unitID 0, handle 0x1, owner true, NullToolkitLock[obj 0x94e9a4]], idx 0],
	eglConfigHandle 0xc, eglConfigID 0xc,
	requested GLCaps[rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.]],
	chosen    GLCaps[egl cfg 0xc, vid 0x8428: rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 24/0/4, sample-ext default, dbl, mono  , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.], [0x7: GLES1, GLES2, VG]]]
, surfaceLock <92856c, 125bb14>[count 1, qsz 0, owner <main-Display-.bcm.vc.iv_nil-1-EDT-1>]
, EGLUpstreamSurfaceHook[ 1920x1080, jogamp.newt.driver.bcm.vc.iv.WindowDriver: 0x64712c68]
, upstreamSurface true ], error 0x3003
	at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:252)
	at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:165)
	at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:442)
	at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2782)
	at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1330)
	at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1335)
	at com.jogamp.newt.opengl.GLWindow.setVisible(GLWindow.java:578)
	at demos.es2.RawGL2ES2demo.main(RawGL2ES2demo.java:303)
Caused by: com.jogamp.opengl.GLException: Creation of window surface w/ surface handle failed (1): EGLGraphicsConfiguration[DefaultGraphicsScreen[EGLGraphicsDevice[type .egl, v1.4.0, connection decon, unitID 0, handle 0x1, owner true, NullToolkitLock[obj 0x94e9a4]], idx 0],
	eglConfigHandle 0xc, eglConfigID 0xc,
	requested GLCaps[rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.]],
	chosen    GLCaps[egl cfg 0xc, vid 0x8428: rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 24/0/4, sample-ext default, dbl, mono  , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.], [0x7: GLES1, GLES2, VG]]], EGLSurface[ displayHandle 0x1
, surfaceHandle 0x0
, size 1920x1080
, UOB[ OWNS_SURFACE ]
, EGLGraphicsConfiguration[DefaultGraphicsScreen[EGLGraphicsDevice[type .egl, v1.4.0, connection decon, unitID 0, handle 0x1, owner true, NullToolkitLock[obj 0x94e9a4]], idx 0],
	eglConfigHandle 0xc, eglConfigID 0xc,
	requested GLCaps[rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.]],
	chosen    GLCaps[egl cfg 0xc, vid 0x8428: rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 24/0/4, sample-ext default, dbl, mono  , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.], [0x7: GLES1, GLES2, VG]]]
, surfaceLock <92856c, 125bb14>[count 1, qsz 0, owner <main-Display-.bcm.vc.iv_nil-1-EDT-1>]
, EGLUpstreamSurfaceHook[ 1920x1080, jogamp.newt.driver.bcm.vc.iv.WindowDriver: 0x64712c68]
, upstreamSurface true ], error 0x3003
	at jogamp.opengl.egl.EGLSurface.createEGLSurfaceHandle(EGLSurface.java:127)
	at jogamp.opengl.egl.EGLSurface.setEGLSurfaceHandle(EGLSurface.java:96)
	at jogamp.opengl.egl.EGLDrawable.createHandle(EGLDrawable.java:74)
	at jogamp.opengl.GLDrawableImpl.setRealized(GLDrawableImpl.java:194)
	at com.jogamp.newt.opengl.GLWindow$GLLifecycleHook.setVisibleActionPost(GLWindow.java:676)
	at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1280)
	at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1318)
	at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:145)
	at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375)
EGLDisplayUtil.EGLDisplays: Shutdown (open: 1)
EGLDisplayUtil: Open EGL Display Connections: 1
EGLDisplayUtil: Open[0]: 0x1: EGLDisplayRef[0x1: refCnt 2]
I am using a clean Raspbian image and using the Oracle Java 8 version. Any ideas? Do I need custom mesa drivers etc?

Cheers,

Michael

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java OpenGL ES 2 bindings using JogAmp JOGL 2

Fri Jan 29, 2016 9:39 am

ishanagi wrote:Hi,
... If I run:-

Code: Select all

java -cp jogamp-fat.jar:. demos/es2/RawGL2ES2demo
on the RPI 2 I get the following exception:-
...
Caused by: com.jogamp.opengl.GLException: Creation of window surface w/ surface handle failed (1): EGLGraphicsConfiguration[DefaultGraphicsScreen[EGLGraphicsDevice[type .egl, v1.4.0, connection decon, unitID 0, handle 0x1, owner true, NullToolkitLock[obj 0x94e9a4]], idx 0],
eglConfigHandle 0xc, eglConfigID 0xc,
requested GLCaps[rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.]],
chosen GLCaps[egl cfg 0xc, vid 0x8428: rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 24/0/4, sample-ext default, dbl, mono , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.], [0x7: GLES1, GLES2, VG]]], EGLSurface[ displayHandle 0x1
, surfaceHandle 0x0
, size 1920x1080
, UOB[ OWNS_SURFACE ]
, EGLGraphicsConfiguration[DefaultGraphicsScreen[EGLGraphicsDevice[type .egl, v1.4.0, connection decon, unitID 0, handle 0x1, owner true, NullToolkitLock[obj 0x94e9a4]], idx 0],
eglConfigHandle 0xc, eglConfigID 0xc,
requested GLCaps[rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.]],
chosen GLCaps[egl cfg 0xc, vid 0x8428: rgba 8/8/8/1, trans-rgba 0x0/0/0/0, accum-rgba 0/0/0/0, dp/st/ms 24/0/4, sample-ext default, dbl, mono , hw, GLProfile[GL2ES2/GLES2.hw], on-scr[.], [0x7: GLES1, GLES2, VG]]]
, surfaceLock <92856c, 125bb14>[count 1, qsz 0, owner <main-Display-.bcm.vc.iv_nil-1-EDT-1>]
, EGLUpstreamSurfaceHook[ 1920x1080, jogamp.newt.driver.bcm.vc.iv.WindowDriver: 0x64712c68]
, upstreamSurface true ], error 0x3003
at jogamp.opengl.egl.EGLSurface.createEGLSurfaceHandle(EGLSurface.java:127)
Hi Michael!

EGL error 0x3003 is returned when the GPU driver have insufficient, GPU memory, resources.
0x3003 == EGL_BAD_ALLOC

I would first check the Raspberry Pi "memory split" configuration that you can change using the raspi-config tool
advanced -> memory split option.
For a 1920x1080 displays then 64Mb should be enough, however try pick value of 128Mb if possible, just in case some other application uses GPU memory on the same system such as the Pi-camera.

There are several tools you can use on the Raspberry PI to check how much memory the GPU have left:
a list of video core tools and debug options is found here: https://github.com/nezticle/RaspberryPi ... Core-Tools
Example use, to check how much memory the GPU have available run:

Code: Select all

sudo /opt/vc/bin/vcdbg reloc
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

Return to “Java”