Porting from JOGL 1.1 to JOGL 2

A place to discuss advanced projects and high-level topics.
Post Reply
csm5125
Posts: 19
Joined: Tue 6. Jul 2010, 19:45

Porting from JOGL 1.1 to JOGL 2

Post by csm5125 » Thu 23. Sep 2010, 19:09

I've decided to start a new thread for the discussion of porting jReality from JOGL 1.1 to JOGL 2.

I have already converted most of the code in the src-jogl folder, the exceptions being:

de.jreality.jogl.JOGLFBOViewer
-I have not yet been able to find how the methods ending in EXT are implemented

de.jreality.jogl.shader.DefaultPointShader
-I cannot find the following:
-GL_POINT_SPRITE_ARB
-GL_COORD_REPLACE_ARB

de.jreality.GLslLoader
-I cannot find the following:
-GL_VERTEX_SHADER_ARB
-GL_FRAGMENT_SHADER_ARB


Additionally, much of the code in src-gpgpu has been broken by the switch, and I cannot yet find many of the EXT functions called in it.

For now, I am removing the _ARB extensions and just using the non-_ARB name (e.g. GL_POINT_SPRITE instead of GL_POINT_SPRITE_ARB). If I am reading this site: http://www.cs.vu.nl/~graphics/jogl-1.1. ... ERSION_ARB correctly, they were treated as the same value anyway.

I'm going to figure out what to do with everything ending in EXT now, but I figured that I would make you aware of what I'm doing.

:::EDIT START - Update:::
I replaced the EXT calls with their non-EXT variants. I'm thinking that this was just a difference between new and old specifications in JOGL
:::EDIT END:::

So, questions:

What is actually in src-gpgpu?
Are you guys also working on this?
Once I've finished and tested this, would you like me to share the code?

csm5125
Posts: 19
Joined: Tue 6. Jul 2010, 19:45

Re: Porting from JOGL 1.1 to JOGL 2

Post by csm5125 » Tue 28. Sep 2010, 19:15

An update.

I've been checking my build against some tutorials, and they seem to work.

However,
Anything that uses the texture 2D loader is broken at the moment due to the call to gluBuild2DMipmapLevels, which is unsupported in this version of JOGL (so far, it seems that this method is an optional part of the standard).

From the GLU class file:

Code: Select all

  // Method descriptor #323 (IIIIIIIIILjava/nio/Buffer;)I
  // Stack: 3, Locals: 11
  public int gluBuild2DMipmapLevels(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, java.nio.Buffer arg9);
     0  new javax.media.opengl.GLException [18]
     3  dup
     4  ldc <String "not implemented"> [90]
     6  invokespecial javax.media.opengl.GLException(java.lang.String) [27]
     9  athrow
      Line numbers:
        [pc: 0, line: 1477]
I'm commenting out the function call for now, but objects in JRViewer - vr no longer have their nice reflections (although I'm not positive that this is the cause of it).

I'm testing out the new build in the CAVE today. I'll keep you posted.

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: Porting from JOGL 1.1 to JOGL 2

Post by steffen » Wed 29. Sep 2010, 12:09

csm5125 wrote:So, questions:

What is actually in src-gpgpu?
Are you guys also working on this?
Once I've finished and tested this, would you like me to share the code?
The gpu stuff is hardly used, and I'll take care that it will work once we have moved to jogl 2. And yes: we definitely want you to share the code ;-) Let us know how it is going...

csm5125
Posts: 19
Joined: Tue 6. Jul 2010, 19:45

Re: Porting from JOGL 1.1 to JOGL 2

Post by csm5125 » Mon 4. Oct 2010, 22:54

I have tested a lot of the tutorial examples, and they all work like they did before.

The biggest problem I'm having so far is when I attempt to use the PortalServerViewer. I can't go into details right now, since I haven't been able to get much time in at the CAVE, but I'll try to get in this week and go over it more. It might have something to do with a combination of settings I'm using right now.

Also, reflections do not currently work.

Aside from that, everything seems to be running smoothly.

I must admit that all of my knowledge of OpenGL is theoretical, and that the JOGL wrappers are not aiding in my understanding. From here on out, I don't know how quickly I'll be able to progress. Most of what I've already done has involved changing enumeration names; my knowledge of the rest is lacking. If I were to share the code as it is now, would your OpenGL-oriented people be able to look at it? Also, how would you like me to share the code with you?

Andre
Posts: 226
Joined: Fri 18. Sep 2009, 11:30

Re: Porting from JOGL 1.1 to JOGL 2

Post by Andre » Mon 4. Oct 2010, 23:09

As far as I know Steffen or Charles have done the jogl-part. Steffen isn't here this week, so we should wait until he comes back for further steps.

Thx for all your work.

Andre

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: Porting from JOGL 1.1 to JOGL 2

Post by steffen » Tue 5. Oct 2010, 15:05

Also, how would you like me to share the code with you?
For now I suggest that you compress your current src-jogl folder and attach it to this thread (or post a link to it).
But I think we really have to use a decentralized version control system (mercurial or git) for jreality. I have just started to look into that...

Steffen.

csm5125
Posts: 19
Joined: Tue 6. Jul 2010, 19:45

Re: Porting from JOGL 1.1 to JOGL 2

Post by csm5125 » Tue 5. Oct 2010, 19:01

Here is a tar file of the modified code.

I couldn't include the updated jar files due to upload restrictions, but this link contains the jars and native libraries.

I am using the jogl.all version of the jar, (as well as the .all versions of newt and nativewindow)

In src-portal, the only file that needed to be modified was CylindricalPerspectiveViewer.java

Also included is a modified build file that references the new libraries (such as nativewindow.all.jar, which is needed for some features I plan to implement). It also includes a target (one-jar) to bundle jReality and third-party libraries into one jar to ease distribution (it also saved me some trouble with running things via .bat files).
Attachments
jReality_jogl2.tar.gz
the start of a port of jReality to JOGL 2
(244.87 KiB) Downloaded 128 times

Post Reply