View unanswered posts | View active topics It is currently Thu Jan 18, 2018 5:12 pm



Reply to topic  [ 10 posts ] 
 OpenGL-ES acceleration using JogAmp JOGL + OpenJDK / Android 
Author Message

Joined: Thu Aug 11, 2011 10:04 pm
Posts: 46
Post OpenGL-ES acceleration using JogAmp JOGL + OpenJDK / Android
:!: Update: JogAmp JOGL 2 rc8 and later ship with pre-built ARM armel and armhf support out of the box:
You can get the latest release here: http://jogamp.org/deployment/jogamp-cur ... atforms.7z
Enjoy! :roll:


Hi team, I will start build/port and test the latest JOGL 2.0 code with OpenGL-ES support made by the JogAmp community for use on the TrimSlice.

Basically I will test all the current "not yet tested" usecases that are currently un-tested by the Jogamp team.
http://jogamp.org/jogl/doc/HowToBuild.html

By running JOGL + OpenJDK + GNU/Linux on TrimSlice will give us an equal hardware accelerated OpenGL-ES stack compared to whats curretly available when using JOGL + Dalvik + Android.


Last edited by xranby on Fri Jun 28, 2013 11:42 am, edited 6 times in total.



Tue Dec 20, 2011 10:45 pm
Profile

Joined: Thu Aug 11, 2011 10:04 pm
Posts: 46
Post Re: OpenGL-ES acceleration using JogAmp JOGL + OpenJDK
Building gluegen and jogl from the latest source went, suprisingly, smooth!

Here are the steps I performed to get the project built.
Code:
# First I installed all build dependencies needed
sudo apt-get install openjdk-6-jdk ant git gcc libgl1-mesa-dev libglu1-mesa-dev xorg-dev libice-dev libsm-dev libx11-dev libxext-dev libxxf86vm-dev libxinerama-dev libxrandr-dev libxrender-dev p7zip-full

# the I cloned the sourcecode into my machine using git
git clone git://jogamp.org/srv/scm/gluegen.git gluegen
git clone git://jogamp.org/srv/scm/jogl.git jogl

# according to the JOGL build instructions i had to unset CLASSPATH to prevent
# the build to pick up any system installed GlueGen or JOGL files during compilation.
unsetenv CLASSPATH
unset CLASSPATH

cd gluegen/make
# Last summer Sven Gothel had tested running JOGL on some armv7 hardware
# and to my delight he have left some environment setup and build scripts
# inside the make/scripts folder found in the GlueGen and JOGL source repository
#
# I had to make sure that TARGET_PLATFORM_LIBS and TARGET_JAVA_LIBS match my
# system, for example to make it build for Ubuntu armhf Precise i had to set:
# export TARGET_PLATFORM_LIBS=/usr/lib/arm-linux-gnueabihf
# export TARGET_JAVA_LIBS=/usr/lib/jvm/default-java/jre/lib/arm
# in the file scripts/make.gluegen.all.linux-armv7.sh
#
sh scripts/make.gluegen.all.linux-armv7.sh

# gluegen BUILD SUCESSFUL

# Next step building of JOGL
cd ../../jogl/make
# Similary here check that TARGET_PLATFORM_LIBS
# and TARGET_JAVA_LIBS are set to match your system
# then start the build.
#
sh scripts/make.jogl.all.linux-armv7.sh

# jogl BUILD SUCESSFUL

# Optional step run all the jogl unittests
sh scripts/make.jogl.all.linux-armv7.sh junit.run


The newly created directory jogl/build-linux-armv7 now contains all files I was looking for!

I can now start experiment running OpenGL-ES tests on the TrimSlice based using the jogl-demos examples: http://jogamp.org/jogl-demos/www/
The JogAmp forum also contain one interesting thread on the topic: GL2ES2-implementation


Last edited by xranby on Wed Mar 14, 2012 3:09 pm, edited 4 times in total.



Wed Dec 21, 2011 9:54 am
Profile

Joined: Thu Aug 11, 2011 10:04 pm
Posts: 46
Post Re: OpenGL-ES acceleration using JogAmp JOGL + OpenJDK
I have now managed to get the JOGL demos running using the nvidia tegra2 drivers.
GLES1 and GLES2 code work fine!

The 1st important part was to make sure that the JOGL code you want to run uses an GLES1, GLES2, GL2ES1 or GL2ES2 profile.
This blog explains: http://michael-bien.com/mbien/entry/jog ... _explained
:idea: If you port/create new Java JOGL code that uses the GL2ES1 or GL2ES2 profile then the code will run on both desktops and mobile devices!

The 2nd important part was to make sure that the JOGL demos got passed the jogl.all-mobile.jar instead of jogl.all.jar or else you would find your code running using the software rendered mesa OpenGL instead of the tegra2 hardware rendered OpenGL-ES drivers for the GL2ES1 and GL2ES2 profiled code.
The tegra2 driver itself can only use the GLES1, GLES2 and VG profiles. The use of jogl.all-mobile.jar makes GL2ES2 profile use GLES2 instead of GL.

Code:
# All classes ending with NEWT contain a main() method.
find jogl/src/test/com/jogamp/opengl/test/junit/jogl/demos/ | grep NEWT

# How to manually start the TestGearsES2NEWT junit demo
# Tip: try TestRedSquareES2NEWT as well.
java -Djava.library.path=gluegen/build-linux-armv7/obj/:jogl/build-linux-armv7/lib/ -cp gluegen/build-linux-armv7/gluegen.jar:jogl/build-linux-armv7/jar/jogl.all-mobile.jar:jogl-demos-git/build-linux-armv7/jogl-demos.jar:jogl-demos-git/build-linux-armv7/jogl-demos-data.jar:jogl-demos-git/build-linux-armv7/jogl-demos-utils.jar:jogl/build-linux-armv7/test/build/classes:/usr/share/java/junit4.jar com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT -time 50000


I have now verified that OpenJDK + jamvm, OpenJDK + cacao and OpenJDK + zero can be used to run JOGL accelerated applications using the Nvidia Tegra2 driver.
When running TestGearsES2NEWT 200x200 then the top fps ends as follow: cacao 1st place 98248.1 fps*, jamvm 63419.6 fps and zero 56619.7 fps on a shared 2nd place, all three JVM's performed good on the Cortex-A9 CPU in combination with the Tegra2 GPU!

* This high fps was obtained without having the output window visible in order to measure how fast the JVM can send frames to the GLES2 driver for rendering, if visual output are enabled then you will see Gears spinning around 200 fps for a 200x200 pixel output window.


Fri Dec 23, 2011 8:44 pm
Profile

Joined: Thu Aug 11, 2011 10:04 pm
Posts: 46
Post Re: OpenGL-ES acceleration using JogAmp JOGL + OpenJDK
Update: JogAmp are adding Armv7 buildbots to their build farm :!:
https://jogamp.org/chuck/
This means that we will soon be able to use prebuilt signed JogAmp JOGL jars for web applets. Code that are using the GL2ES2 profile will enable 3D games and applications to run unmodified onboth desktop and mobile grade OpenGL GPU's.

JogAmp have been updated to have pre-preference to use hardware accelerated OpenGL ES drivers if both Mesa software render drivers and Nvidia hardware accelerated OpenGL ES drivers are found on the same system. This enables hardware acceleation out of the box on ARM for all GL2ES2 applications.

Processing 2.0 gets hardware acceleration:
The Processing developement tools have switched to JogAmp JOGL 2.0 for all OpenGL rendering in the Processing 2.0 release, this enable hardware acceleration on the trimslice for all "P3D" processing sketches that uses an OpenGL canvas.
viewtopic.php?f=48&t=488 - Processing 2.0a5+GLES2 support

The next logical step to accelerate OpenJDK Java on ARM are to make use of this updated JOGL 2.0 library for Java2D to speed up all legacy, swing/awt, java applications on ARM. I hope this can get realized by using the glg2d API in combination with JogAmp JOGL 2.0 on ARM. http://brandonborkholder.github.com/glg2d/

All good.
Xerxes


Last edited by xranby on Wed Mar 28, 2012 10:27 pm, edited 1 time in total.



Thu Feb 23, 2012 6:02 pm
Profile

Joined: Tue Mar 22, 2011 10:23 pm
Posts: 2
Post Re: OpenGL-ES acceleration using JogAmp JOGL + OpenJDK
Wow, that's gorgeous news!


Sat Feb 25, 2012 10:09 pm
Profile

Joined: Thu Aug 11, 2011 10:04 pm
Posts: 46
Post Re: OpenGL-ES acceleration using JogAmp JOGL + OpenJDK
Note on TrimSlice L4T driver support:

The L4T Alpha drivers shipped with the Trimslice 1.01 are simply not supported.
The reason why are that the alpha driver contains a bug that returns the same egl display handle for all egl displays while they should be unique, this totally break JOGL shared display initialization, this are fixed in the L4T beta drivers.

JogAmp JOGL work in combination with the Nvidia Tegra2 L4T beta drivers shipped with the l4t-installer-2.01.img.zip install image.

Install the 2.01 image and manually install openjdk: apt-get install openjdk-6-jre
Done, jogamp will now work right out of the box!


Last edited by xranby on Mon Feb 27, 2012 6:22 pm, edited 1 time in total.



Sun Feb 26, 2012 10:37 pm
Profile

Joined: Thu Aug 11, 2011 10:04 pm
Posts: 46
Post Re: OpenGL-ES acceleration using JogAmp JOGL + OpenJDK
I have created some precompiled JogAmp JOGL jar (13mb) for easy testing:

Code:
wget http://labb.zafena.se/jogamp/armv7/jogamp-armv7.tar.gz
tar zxvf jogamp-armv7.tar.gz
cd jogamp
sh ./run-mobile.sh


More detailed instructions and sourcecode used available here: http://labb.zafena.se/?p=532


Mon Feb 27, 2012 1:02 pm
Profile

Joined: Thu Aug 11, 2011 10:04 pm
Posts: 46
Post Re: OpenGL-ES acceleration using JogAmp JOGL + OpenJDK
I have posted a Vertex and Fragment shader introduction contained in a single .java source file. Learn how to draw a fun colored triangle using the JogAmp JOGL OpenGL ES 2 API.
https://github.com/xranby/jogl-demos/blob/master/src/demos/es2/RawGL2ES2demo.java#L54

#make sure you got openjdk-6 and p7zip-full installed in order to complete this tutorial
#sudo apt-get install openjdk-6-jdk p7zip-full

wget http://jogamp.org/deployment/jogamp-current/archive/jogamp-all-platforms.7z
7z x jogamp-all-platforms.7z
cd jogamp-all-platforms
mkdir -p demos/es2
cd demos/es2
wget https://raw.github.com/xranby/jogl-demos/master/src/demos/es2/RawGL2ES2demo.java
cd ../..
javac -cp jar/jogl-all.jar:jar/gluegen-rt.jar demos/es2/RawGL2ES2demo.java
java -cp jar/jogl-all.jar:jar/gluegen-rt.jar:. demos.es2.RawGL2ES2demo


Last edited by xranby on Fri Jun 28, 2013 11:36 am, edited 1 time in total.



Fri Mar 23, 2012 10:31 am
Profile

Joined: Thu Aug 11, 2011 10:04 pm
Posts: 46
Post [SECURITY] JogAmp 2.0.2-rc12 JOGL JOAL JOCL & Gluegen Releas
http://labb.zafena.se/?p=799 - [SECURITY] JogAmp 2.0.2-rc12 JOGL JOAL JOCL & Gluegen Released!
http://forum.jogamp.org/Release-2-0-2-r ... 29471.html - Release announcement for JogAmp 2.0.2-rc12

This 2.0.2-rc12 include the largest security review in the 10-year history of JOGL, important if you use certificate signed javaws "jnlp" or applet deployment; it also contain several notable improvements for OpenGL ES use on ARM:
* Automatic ARM native soft & hardfloat detection; using JDK 8 on armhf will now work out of the box.
* Passed Google Android Validation w/ DoW Game Ticket to Ride
* Maven Support
* NEWT Multiple Monitor Support
* Multi Touch Support
* Scroll Wheel Gesture (Android)

It worth pointing out that an application written for JogAmp JOGL GL2ES2 or GL2ES1 profile work on both Dalvik in Android mode and OpenJDK on X11 trim-slice systems.

Cheers
Xerxes


Fri Jun 28, 2013 11:34 am
Profile

Joined: Thu Aug 11, 2011 10:04 pm
Posts: 46
Post [RELEASE] JogAmp 2.0.2; JOGL10y celebration & SIGGRAPH 2013
http://labb.zafena.se/?p=859 - [RELEASE] JogAmp 2.0.2; JOGL10y celebration & SIGGRAPH 2013 BOF
http://forum.jogamp.org/Release-2-0-2-td4029632.html - Release announcement for JogAmp 2.0.2

"This JogAmp JOGL version 2.0.2 release marks the end of the first major JogAmp release cycle that started with the v2.0-rc1 around two and a half years ago, “End of RCs ..“. JogAmp JOGL is a modern successor to the no longer maintained JOGL 1.1.1a. The 2.0.2 release added support for OpenGL versions up to 4.3, and OpenGL ES versions 1, 2, and 3."


Thu Aug 22, 2013 11:00 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 0 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.