www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: bilbo0s on April 13, 2009, 11:04:55 pm

Title: Is it possible to support JoGL?
Post by: bilbo0s on April 13, 2009, 11:04:55 pm
Hello All,

I know that I am new here, but I have been using jPCT for
quite some time.  It is a great little engine.  Thanks to you
who make it possible.

I am writing because I use jPCT in a bit of a different fashion
than everyone else here.  I use JoGL to talk to OpenGL as
opposed to LWJGL.  I do this by supporting a JoGL shim that
masquerades as LWJGL.

My question is, is there a way that JoGL can get supported
officially?  Getting all of the shader stuff working when the
118 beta was released was a bit of a pain.  I am thinking
that as you go forward you will have stuff that I want to
work with via OpenGL as well.

The reason I use JoGL is because it makes my applets work
in a browser without a security warning.  This actually
makes users a good deal more comfortable with my product.

I am not a lazy person.  If jPCT were open source I would
create the interfaces for pluggable GL layers myself.  I have
been trying to just shadow your development, and not
burden you with requests like an ingrate.  I know how it
feels when people do that.  But now I think I am at a point
where I have to ask, or we could get wildly out of sync.

The other option is for me to do a rewrite of the core
engine blind.  This would mean that, initially anyway, I would
not have software rendering.  Frankly, there are enough
java game engines floating around out there.  We don't need
more in my opinion.

For these reasons I am writing to ask that you support
JoGL officially.  I will even write it for you if you like.  I just
would like you to put it in your engine.

By way of information, my jPCT shadow project is tracking
the main jPCT for the purposes of supporting two pieces of
functionality.  The first is a JoGL OpenGL layer.  The second
is a JBullet real time physics engine.  Right now they are
both integrated up to version 1.18 beta.  I would wager that
a lot of your users are all shadowing the main jPCT releases
in a similar fashion.  So there are probably a handful of
people out there who are all supporting their own JoGL
shim to use jPCT with JoGL.  I think this is wasted effort.

Please let me know if you think that you would be willing
to support JoGL.  If not, I thank you any way for everything
you have contributed to the gaming community so far.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 14, 2009, 07:27:24 am
Hmm...i was under the impression that LWJGL already is properly signed: http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/applet-lwjglinstaller (http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/applet-lwjglinstaller)
I've tried the demo applet from the LWJGL-site and haven't seen any security dialog.  ???
Title: Re: Is it possible to support JoGL?
Post by: bilbo0s on April 14, 2009, 07:47:25 am
The LWJGL jars are properly signed, but with a certificate from the Oddlabs org.
You have probably at some point already accepted this certificate.  New users
coming to a jPCT site in the field don't have that certificate accepted, and will
get a security warning.  Notice the LWJGL documentation says:

"Upon release of LWJGL 1.0, we will provide proper signed packages so that
 any user can run applets without having to invest in a CERTIFICATE."

The certificate is what is used to sign the jar.  The security warning is what
is used to prompt the user to accept the certificate as valid.

What they mean is that developers can write applets and run them without
having to buy a certificate to sign their jars.  What they leave out is that you
will need to accept their certificate on your machine.  This is not a problem for
most developers, but for users in the field it is an issue.

One way that I use to test my applets is to make a trip to the Apple Store.  When
running under JoGL, no certificate is prompted for, when running under LWJGL,
a certificate is prompted for.

One way to see what I am saying would be for you to remove all of your
certificates, except the default Sun Microsystems certificates.  These
can be removed from the certificate store via
the java control panel.

Your machine should now have only the certificates that a fresh install of
Java will have.  So now run the JoGL applet demo at:

 https://jogl-demos.dev.java.net/applettest.html

After that run the LWJGL applet demo at:

 http://lwjgl.org/applet


You will see that only the LWJGL applet will prompt for a security clearance.
Title: Re: Is it possible to support JoGL?
Post by: bilbo0s on April 14, 2009, 07:50:27 am
Come to think of it . . .

It would be much simpler to just delete the certificate
from Oddlabs.  You will see it in the list in the Java
control panel certificate store.  This certificate does
not ship with Java by default, so users have to accept
it for it to be put in the store.

So just delete the Oddlabs certificate and then try
the two applets that I pointed out.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 14, 2009, 08:07:28 am
I see...after removing the Oddlabs-cert, the LWJGL-appletloader pops up a dialog. But the JOGL-applet does the same thing on my machine... ???
Title: Re: Is it possible to support JoGL?
Post by: bilbo0s on April 14, 2009, 08:28:16 am
The JoGL applet probably does this because somewhere along the
way, just as you accepted the Oddlabs certificate.  You probably
deleted your Sun certificate.  More probably you deleted ALL of
your certificates at some point.

The other option is that you have an old JRE.  I don't remember
the release when they started including the certificate that is used
to sign the jsr-231 jars.

Let me try to look it up.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 14, 2009, 08:30:24 am
I haven't deleted any other certs as far as i know. Java is 1.6.0_05...it's my machine @ work, i can't update it...
About the jogl-renderer-thing...i'll think about the options later today. I'm short on time right now.
Title: Re: Is it possible to support JoGL?
Post by: zammbi on April 14, 2009, 09:00:47 am
No popup for me here.
I never knew that JOGL was signed by sun and therefore gets no popup.

But I would think that adding JOGL support isn't going to be so easy?
Title: Re: Is it possible to support JoGL?
Post by: bilbo0s on April 14, 2009, 09:17:28 am
I don't know now.  EgonOlsen has me a little unsure of myself now.
I know that the JoGL jars are signed by sun.  What I am not sure
of is why Egon is getting a security pop up.  Maybe Sun does not
ship that certificate by default after all?

I'm still looking.  It would be funny if both Egon and I were running
in a controlled environment.  His making him think LWJGL had no
pop up and mine making me think that JoGL had no pop up.

I'm still digging on this.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 14, 2009, 09:50:28 am
This is it, maybe that helps:

(http://www.jpct.net/pics/cert_sun.png)
Title: Re: Is it possible to support JoGL?
Post by: fireside on April 14, 2009, 02:30:58 pm
It looks like it is possible to make unsigned applets with Jogl according to this page:
http://www.natalnet.br/docs/jogl/com/sun/opengl/util/JOGLAppletLauncher.html

Quote
Basic JOGL installer for Applets. The key functionality this class supplies is the ability to deploy unsigned applets which use JOGL. It may also be used to deploy signed applets in which case multiple security dialogs will be displayed.

That would still be assuming javaio or whatever it is doesn't throw something.

This is from the jogl user's guide:
http://www.inf.furb.br/gcg/disciplinas/cg/JoGL-JavaNet/JoGL-JavaNet-Userguide.html

Quote
The JOGLAppletInstaller is distributed inside jogl.jar as a utility class in com.sun.opengl.util. It requires that the developer host a local, signed copy of jogl.jar and all of the jogl-natives jars; the certificates must be the same on all of these jars. Note that in the release builds of JOGL all of these jars are signed by Sun Microsystems, so the developer can deploy applets without needing any certificates.

It would be cool if a hardware app could be done unsigned.  On the other hand, I think more and more people are getting used to accepting these things without panicking.  Still, if I had my druthers, I'd pick the unsigned any day.
Title: Re: Is it possible to support JoGL?
Post by: bilbo0s on April 14, 2009, 06:56:27 pm
OK,

After further review, I think both LWJGL and JoGL
may pop up security dialogs in some cases.  LWJGL
pops one up all of the time, and JoGL seems to pop
one up on some versions of Java and not others?

Some interesting behavior, but it is best to have
that pop up NOT show up, when possible in my
opinion.  I'm for any kind of mitigation of that.
There are other reasons that I would want to
use JoGL as well. Java2D integration is one.  Basically what the
JoGL Java2D integration allows you to do is to
write a game using jPCT, and then implement your
user interface in Java2D using the overlay.  This is
done at full hardware speed, and you have access
to all of Java's Font technology.  You can even
write the overlay with JavaFX.  So I still want
the JoGL integration with jPCT.

I don't know how others feel.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 14, 2009, 08:21:02 pm
You have mail...
Title: Re: Is it possible to support JoGL?
Post by: paulscode on April 14, 2009, 09:11:14 pm
It looks like it is possible to make unsigned applets with Jogl according to this page:
http://www.natalnet.br/docs/jogl/com/sun/opengl/util/JOGLAppletLauncher.html
I recall looking into the JOGL Applet Launcher before I came across jPCT, and as I recall it still had a security message popup the first time a JOGL applet launcher applet was encountered.  My guess is that although the signature is from Sun Microsystems, it is not deployed with Java by default.  So there really isn't any advantage to the JWJGL applet launcher vs the JOGL one (other than the fact that people might be more inclined to trust the name "Sun Microsystems" than the name "Oddlabs").
Title: Re: Is it possible to support JoGL?
Post by: AGP on April 15, 2009, 06:43:14 pm
Egon, can I ask what it is you e-mail him? I'm very interested in this issue right now.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 15, 2009, 07:42:13 pm
Egon, can I ask what it is you e-mail him? I'm very interested in this issue right now.
Sure. That were the GL related parts of jPCT for him to port to jogl...which he already did. However, i'm undecided what to do with the port. I can't use it in the way it is, because it's a straight port and it removes LWJGL support. I also don't want to take care of another renderer nor do i want to add an abstraction layer that increases size and slows things down. I have an idea that *might* work instead and i'm currently looking at the port to give it a try...i'll keep you posted.
Title: Re: Is it possible to support JoGL?
Post by: AGP on April 15, 2009, 08:30:31 pm
Cool, thanks a lot.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 15, 2009, 11:19:34 pm
Works pretty well so far...many many thanks to bilbo0s for his initial port. It has been VERY helpful to me. What i have working now is this: jPCT's renderers are still using LWJGL as ever before. In addition, i'll supply a small jar (around 15kb) called glfacade.jar. If this jar is in the classpath, LWJGL must not be there and JOGL has to be. If this is given and you enable jPCT's canvas renderer, you'll get a JOGL GLCanvas instead and all the rendering magically happens on this canvas. If you enable the normal GLRenderer, you'll get a crash...which is not nice. The denial should be more gracefully...i guess i have to work on this some more...


Title: Re: Is it possible to support JoGL?
Post by: JavaMan on April 16, 2009, 12:24:08 am
Great Egon :D I'm not sure what are the big advantages of JOGL vs LWJGL, but its nice to be able to JOGL instead of LWJGL if I ever need to. Also, JOGL should continue to have support from Sun since it is used, I think, in JavaFX.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 16, 2009, 07:29:20 am
Great Egon :D I'm not sure what are the big advantages of JOGL vs LWJGL, but its nice to be able to JOGL instead of LWJGL if I ever need to. Also, JOGL should continue to have support from Sun since it is used, I think, in JavaFX.
Personally, i don't see any advantages...expect for the security dialog thing maybe. I like LWJGL more, but maybe i'm just used to it. But with the current implementation, i can almost ignore the fact that JOGL support is there somehow, which is what i wanted. The drawback is, that you can't switch renderers on the fly, but why would you!? At least that's better than having multiple renderers added to the engine and only one works correctly (like in JME and xith, where JOGL support is broken in JME and LWJGL support is broken in xith).
Title: Re: Is it possible to support JoGL?
Post by: zammbi on April 16, 2009, 07:39:01 am
Sounds great that your adding in JOGL support. Everyone at the JavaGaming.Org site knows 1 person over who would loves JOGL ::) , which he says it has less bugs. If that's true or not, at least you get people who think that will use your engine now.  :)
You could also benchmark and see if there's any speed differences  ;) That's if your not sick of benchmarks....
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 16, 2009, 08:11:33 am
Everyone at the JavaGaming.Org site knows 1 person over who would loves JOGL ::) , which he says it has less bugs.
Ahem...yes. Must be the reason why the stable release of JOGL didn't even work out of the box because a jar was missing...

You could also benchmark and see if there's any speed differences  ;) That's if your not sick of benchmarks....
It should be a little slower than LWJGL, because it carries the overhead of the AWTGLRenderer with it and all GL-calls go through the facade...plus a tiny little bit of reflection code that i had to use. It shouldn't really matter though and the reflection part can be speed up anyway if needed.
Title: Re: Is it possible to support JoGL?
Post by: AGP on April 16, 2009, 08:10:56 pm
Also, from what I understand, lwjgl supports OpenGL 3.0 whereas JoGL only supports 2. Still, I'm getting my ass kicked by an lwjgl applet (their appletloader system is clever but doesn't seem to work all the time), so maybe JoGL can help there. Again, Egon, I appreciate all you do here a whole lot. So thanks.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 16, 2009, 08:32:14 pm
OpenGL 3.0 doesn't have much relevance IMHO. If you create a real OpenGL 3.0 context, absolutely nothing will work in jPCT (or any other engine), because they have deprecated almost everything that isn't shader related. In a real 3.0 context, you have to do everything with shaders...there's no support for any fixed function pipeline stuff anymore. However, you can use an 3.0 context that stays compatible with 2.x...but all you get are a few extensions. Nothing to get crazy about.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 16, 2009, 09:28:27 pm
I've just released a second beta that includes the JOGL option. See the news section for more details.
Title: Re: Is it possible to support JoGL?
Post by: EgonOlsen on April 16, 2009, 09:40:32 pm
It should be a little slower than LWJGL, because it carries the overhead of the AWTGLRenderer with it and all GL-calls go through the facade...plus a tiny little bit of reflection code that i had to use. It shouldn't really matter though and the reflection part can be speed up anyway if needed.
I stand corrected: Performance is on par with LWJGL. The additional overhead of the facade and reflection isn't noticable.