JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

classic Classic list List threaded Threaded
249 messages Options
1234567 ... 13
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

dardzull@yahoo.com
gouessej wrote
Dardzull, is there the same problem of performance with the official branch (with our latest fixes)?

I have been using the code from https://github.com/noxo/jmonkey-engine-jogl-gles/tree/unified_renderer.  The official JME3 on the svn site does not work on the Raspberry Pi.  =(  It does not like being used on an Arm device.  It looks like the github version has been hacked to ignore that fact.

Of the github unified renderer versions, the "Master" branch seems to work fine running at 60fps, and the "unified_renderer" branch that was updated yesterday dropped down to 18-20fps for some reason.  Both are working the same way in regards to the mentioned texture buffer issue.
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

dardzull@yahoo.com
In reply to this post by gouessej
Additional info on error running the official svn nightly.  

java.lang.UnsupportedOperationException: Unsupported architecture: arm
        at com.jme3.system.JmeSystemDelegate.is64Bit(JmeSystemDelegate.java:150)
        at com.jme3.system.JmeSystemDelegate.getPlatform(JmeSystemDelegate.java:157)
        at com.jme3.system.JmeDesktopSystem.initialize(JmeDesktopSystem.java:312)
        at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:231)
        at com.jme3.system.JmeSystem.newContext(JmeSystem.java:137)
        at com.jme3.app.Application.start(Application.java:385)
        at com.jme3.app.Application.start(Application.java:366)
        at com.jme3.app.SimpleApplication.start(SimpleApplication.java:131)
        at mygame.Main.main(Main.java:64)

Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

noxo
This post was updated on .
Dardzull wrote
Additional info on error running the official svn nightly.  
Latest JME in Google Code seems to have few bits missing for RPI support.

"unified_renderer" branch in Github works now with RPI, and also has latest stuff (r10290)
from JME Google Code repository.

also created branch (unified_renderer_original) of original working version.

Bon Friday
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

dardzull@yahoo.com
Ok, moved to the latest version and getting 60fps.  Everything looks ok.  I will keep testing and let you know if i come up with anything.
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

dardzull@yahoo.com
In reply to this post by gouessej
I do have one minor change request.  That is to honor the Max FPS setting ( setFrameRate(int) ), if it is supplied.  

Currently the jogl seems to only want to run as fast as it can on the PC and a flat 60 on the RPi.  Is there a way to do this?
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

dardzull@yahoo.com
In reply to this post by gouessej
gouessej wrote
Please look at my latest commits. I have integrated some changes with some refined fixes. There are still some things to do for the alpha and for the profile.
The RPi really does not like Simple Water (jme3test.water.TestSimpleWater.java).  The default texture resolution is 512x512, but I walked it down to 8x8 to test if there was a size that would work.

Exception in thread "main-AWTAnimator-1" com.jme3.renderer.RendererException: Resolution 8:8 is not supported.
        at com.jme3.renderer.jogl.JoglRenderer.updateRenderBuffer(JoglRenderer.java:1420)
        at com.jme3.renderer.jogl.JoglRenderer.updateFrameBufferAttachment(JoglRenderer.java:1477)
        at com.jme3.renderer.jogl.JoglRenderer.updateFrameBuffer(JoglRenderer.java:1511)
        at com.jme3.renderer.jogl.JoglRenderer.setFrameBuffer(JoglRenderer.java:1606)
        at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:961)
        at com.jme3.water.SimpleWaterProcessor.postQueue(SimpleWaterProcessor.java:237)
        at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:979)
        at com.jme3.renderer.RenderManager.render(RenderManager.java:1029)
        at com.jme3.app.SimpleApplication.update(SimpleApplication.java:252)
        at com.jme3.system.jogl.JoglNewtDisplay.display(JoglNewtDisplay.java:241)
        at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:373)
        at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:358)
        at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:280)
        at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:655)
        at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:594)
        at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:543)
        at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:74)
        at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:142)
        at com.jogamp.opengl.util.Animator$MainLoop.run(Animator.java:176)
        at java.lang.Thread.run(Thread.java:722)
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

gouessej
Administrator
In reply to this post by dardzull@yahoo.com
I would have to modify the implementation by using an FPSAnimator but enabling the V-sync should be enough.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

dardzull@yahoo.com
gouessej wrote
I would have to modify the implementation by using an FPSAnimator but enabling the V-sync should be enough.

I dug around the code a little, and everything is there.  However you forgot to add one line to JoglNewtDisplay.java  ... (@noxo might want to add this to his github too.)

The applySettings function is missing (never made a diff patch):

frameRate = settings.getFrameRate();


Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

Xerxes RÃ¥nby
In reply to this post by gouessej
The libgdx author asked me to create a libgdx pull request to make the work done available upstream
Mario Zechner @badlogicgames wrote
@xranby what's the state of the Jogamp libgdx backend? I'd like to compile libs for RPi and pull it into our repo.
and so i did: https://github.com/libgdx/libgdx/pull/234
This pull includes gouessej's master + my last JogAmp 2.0.2 fixes for use with the latest signed JogAmp pre 2.0.2 release that got demoed on FOSDEM:
http://jogamp.org/deployment/archive/master/gluegen_629-joal_396-jogl_903-jocl_741-signed/
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

Sven Gothel
Administrator
On 02/06/2013 04:37 PM, Xerxes RÃ¥nby [via jogamp] wrote:

> The libgdx author asked me to create a libgdx pull request to make the work
> done available upstream
>
>     Mario Zechner @badlogicgames wrote
>     @xranby what's the state of the Jogamp libgdx backend? I'd like to compile
>     libs for RPi and pull it into our repo.
>
> and so i did: https://github.com/libgdx/libgdx/pull/234
> This pull includes gouessej's master + my last JogAmp 2.0.2 fixes for use with
> the latest signed JogAmp pre 2.0.2 release that got demoed on FOSDEM:
> http://jogamp.org/deployment/archive/master/gluegen_629-joal_396-jogl_903-jocl_741-signed/
Nice .. nice .. I was surprised at FOSDEM to see libGDX working like a charm
w/ JOGL/NEWT.

TODO:
  - Solve the 'libGDX native JAR problem'
    - Is there actually a problem ?
    - Does it already separate and auto load proper native JAR files ?

  - Linux event Tracker: Mouse Wheel

  - Maybe Bug 676

  - OpenAL: Windows CMake
    - assuming this is related, i.e. using JogAmp's JOAL ..

.. just my infamous brainstorming :)

~Sven



signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

Xerxes RÃ¥nby
Sven Gothel wrote
On 02/06/2013 04:37 PM, Xerxes RÃ¥nby [via jogamp] wrote:
> The libgdx author asked me to create a libgdx pull request to make the work
> done available upstream
>
>     Mario Zechner @badlogicgames wrote
>     @xranby what's the state of the Jogamp libgdx backend? I'd like to compile
>     libs for RPi and pull it into our repo.
>
> and so i did: https://github.com/libgdx/libgdx/pull/234
> This pull includes gouessej's master + my last JogAmp 2.0.2 fixes for use with
> the latest signed JogAmp pre 2.0.2 release that got demoed on FOSDEM:
> http://jogamp.org/deployment/archive/master/gluegen_629-joal_396-jogl_903-jocl_741-signed/

Nice .. nice .. I was surprised at FOSDEM to see libGDX working like a charm
w/ JOGL/NEWT.

TODO:
  - Solve the 'libGDX native JAR problem'
    - Is there actually a problem ?
    - Does it already separate and auto load proper native JAR files ?
libgdx got its own native loader that basically needs some minor fixing to correctly load an arm libgdx native when deployed on ARM GNU/Linux systems. I will try fix this with libgdx upstream. of course the missing os.arch thingie makes it as hard to implement on libgdx compared to the jogamp loader.

Sven Gothel wrote
  - Linux event Tracker: Mouse Wheel

  - Maybe Bug 676
Things to fix for jogamp in general, thus no blocker for the libgdx merge.

Sven Gothel wrote
  - OpenAL: Windows CMake
    - assuming this is related, i.e. using JogAmp's JOAL ..

.. just my infamous brainstorming :)

~Sven
libgdx runs their own jenkins that to my knowledge do build openal-soft as well, i will try locate its scripts and cross pollinate!
also this is for jogamp in general

Xerxes
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

Sven Gothel
Administrator
On 02/06/2013 04:58 PM, Xerxes RÃ¥nby [via jogamp] wrote:

>     Sven Gothel wrote
>
>     TODO:
>       - Solve the 'libGDX native JAR problem'
>         - Is there actually a problem ?
>         - Does it already separate and auto load proper native JAR files ?
>
> libgdx got its own native loader that basically needs some minor fixing to
> correctly load an arm libgdx native when deployed on ARM GNU/Linux systems. I
> will try fix this with libgdx upstream. of course the missing os.arch thingie
> makes it as hard to implement on libgdx compared to the jogamp loader.
>
Filed Bug 681 and I will work on it ASAP, since this is a blocking point.

https://jogamp.org/bugzilla/show_bug.cgi?id=681

Would be great if libGDX can re-use the ELF header parsing ..


>     Sven Gothel wrote
>       - Linux event Tracker: Mouse Wheel
>
>       - Maybe Bug 676
>
> Things to fix for jogamp in general

Yes, of course.

>
>     Sven Gothel wrote
>       - OpenAL: Windows CMake
>         - assuming this is related, i.e. using JogAmp's JOAL ..
>
>     .. just my infamous brainstorming :)
>
>     ~Sven
>
> libgdx runs their own jenkins that to my knowledge do build openal-soft as
> well, i will try locate its scripts and cross polinate!
Ah .. this way you might be able to fix our openal-soft issue
on Windows and Linux/ARMv6[soft-float] - GREAT!

~Sven



signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

gouessej
Administrator
In reply to this post by dardzull@yahoo.com
Dardzull wrote
The applySettings function is missing (never made a diff patch):

frameRate = settings.getFrameRate();
Ok I'll do that.

I only have a little time, I have to give my computer to someone else (because she needs Adobe Flash which requires SSE2 :() and to repair my former one. Thank you Sven for the laptop.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

krishnak
I am trying to get  JMonkey3 to use JOGL2. I have installed JMonkey development plugin in eclipse. I have downloaded the JOGL2 jars and included them in the project library.

How do I make a sample application to use JOGL2 instead of LWJGL.

Could you point me to some code examples.
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

gouessej
Administrator
Hi

I like Eclipse but using Netbeans is preferable for JMonkeyEngine 3.

Just extend or use com.jme3.app.SimpleApplication with the following lines in the start method:
settings.setRenderer("JOGL");
settings.setAudioRenderer("JOAL");
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

krishnak
Many thanks for your snippet, I tried it and I get a NullPointerException at the settings.setRenderer("JOGL");

I am trying to run the code in Ubuntu 32 Bit desktop. I have the following jars in addition to Jmonkey3 jars in the class path.

jogl-all.jar
jogl-all-native-linux-i586.jar
gluegen-rt.jar
gluegen-rt-native-linux-i586.jar
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

gouessej
Administrator
Please post the whole stack trace. I can't help you if you don't provide very accurate information. I'm under Mageia Linux 2 and it works very well, there is no problem with GNU Linux.

Edit.: You need all those JARs:
joal.jar
joal-natives-linux-i586.jar
jogl-all.jar
jogl-all-natives-linux-i586.jar
gluegen-rt.jar
gluegen-rt-natives-linux-i586.jar

Edit.2: You might need to build JMonkeyEngine 3 from the latest source code to make it work.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

krishnak
I am posting the full code - it is  just a sample app from the tutorial.

package mygame;

import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;




/**
 * test
 * @author normenhansen
 */
public class Main extends SimpleApplication {

    public static void main(String[] args) {
        Main app = new Main();
        app.start();
    }

    @Override
    public void simpleInitApp() {
        Box b = new Box(Vector3f.ZERO, 1, 1, 1);
        Geometry geom = new Geometry("Box", b);

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Blue);
        geom.setMaterial(mat);

        rootNode.attachChild(geom);
    }

    @Override
    public void simpleUpdate(float tpf) {
        //TODO: add update code
    }

    @Override
    public void simpleRender(RenderManager rm) {
        //TODO: add render code
    }
    public void start()
    {
    settings.setRenderer("JOGL");
    settings.setAudioRenderer("JOAL");
    }
}


OUTPUT
Exception in thread "main" java.lang.NullPointerException jME3_SDK_3.0RC2-linux.sh

        at mygame.Main.start(Main.java:49)
        at mygame.Main.main(Main.java:22)

As you can see - the stack trace doesn't say much. If I remove the start or comment those settings.setRenderer - I get the code running with lwjgl.

Do I need to build JMonkey from source from google code in order to get JOGL working ? I am currently checking out the code using SVN to try to build it from source

Till now I have been using jME3_SDK_3.0RC2-linux.sh

I have tried the code on JMonkeyEngine (Netbeans) as well as with Eclipse - the error remains the same.


Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

krishnak
In reply to this post by gouessej
I posted before your Edit message - I will try building it from source and let you know if there are any issues.
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2.0 (OpenGL/OpenGL-ES) backend for LibGDX

gouessej
Administrator
In reply to this post by krishnak
The settings are still null when you try to use the JOGL renderer. I'll look at existing examples.

Edit.: Rather do that:
@Override
public void start() {
      showSettings = false;
      AppSettings appSettings = new AppSettings(true);
      appSettings.setRenderer("JOGL");
      appSettings.setAudioRenderer("JOAL");
      setSettings(appSettings);
      super.start();
}
Julien Gouesse | Personal blog | Website
1234567 ... 13