Porting RoomTiny to Jogl

classic Classic list List threaded Threaded
40 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

BrickFarmer
elect wrote
Ah, are you on mac os? Shit I guess that error sounds like sdk related... which dk you have? Have you been successfully running a demo?
OSK 10.8.5, Java 7, DK2

I've had a few demos running that came with SDK 041.  And I'm just porting a SceneKit demo over to SDK 041, but next I'm keen to get something running with Java :)  I think JOVR is built against the latest SDK, but I'm missing a demo to get me started, yours looked perfect :)
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

elect
BrickFarmer wrote
OSK 10.8.5, Java 7, DK2

I've had a few demos running that came with SDK 041.  And I'm just porting a SceneKit demo over to SDK 041, but next I'm keen to get something running with Java :)  I think JOVR is built against the latest SDK, but I'm missing a demo to get me started, yours looked perfect :)
This guy here

http://webcache.googleusercontent.com/search?q=cache:hmJ43Xdz-LoJ:https://developer.oculusvr.com/forums/viewtopic.php%3Ff%3D20%26t%3D8070%26start%3D20+&cd=1&hl=en&ct=clnk&gl=de&client=firefox-a

had the same error on linux

In the meanwhile trying to finding a solution you could play with it on win, dont you have bootcamp?
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

BrickFarmer
I've asked on the Oculus forums now, but thanks for your time.  I only have OSX, although looking at the requirements for DK2 I might be forced into buying a windows gaming laptop soon :)
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

elect
BrickFarmer wrote
I've asked on the Oculus forums now, but thanks for your time.  I only have OSX, although looking at the requirements for DK2 I might be forced into buying a windows gaming laptop soon :)
I read somewhere they suggest at least the nvidia 650m... what do you have?
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

Sven Gothel
Administrator
In reply to this post by elect
On 08/19/2014 04:11 PM, Sven Gothel wrote:

> On 08/19/2014 10:51 AM, elect [via jogamp] wrote:
>> Yeah, I could when I will have some spare time, anyway the thing is the oculus
>> example has a lot of processing inside, included a timewarp correction, motion
>> prediction, gamma correction, etc..
> Should be no problem .. hmm.
> But if anything in our OVR is missing, pls tell me - so I can add.
>
>>
>> Moreover, I get the distorted meshes directly from the sdk based on the oculus
>> type (dk1 or dk2)
>
> Our binding operates similar, i.e. using OVR client rendering,
> a.k.a using the VBO distortion mesh!
>
> We do not support OVR rendering passing a GL context to the OVR SDK,
> since this simply will not work w/ any GL context (EGL, GLX, ..).
> And dealing w/ GL is surely 'our' task.
>
> Ofc, I need to update the OVR SDK to the latest version,
> clearly my TODO soon :)
Problem: 0.4.1 beta has no GNU/Linux version,
plus it seems that a binary blob runtime 'dongle' is required.

'Interesting' development in the Oculus VR camp,
and I mean - sounds sad.

Have to check how to utilize the device w/o a binary blob
and ofc for all platforms!

~Sven



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

Re: Porting RoomTiny to Jogl

Sven Gothel
Administrator
In reply to this post by elect
On 08/21/2014 09:07 AM, Sven Gothel wrote:
>
> Problem: 0.4.1 beta has no GNU/Linux version,
> plus it seems that a binary blob runtime 'dongle' is required.
>
> 'Interesting' development in the Oculus VR camp,
> and I mean - sounds sad.

There seems to be 'hacks' to enable proper DK2 detection
and maybe even the new position tracking:
  <https://github.com/jherico/OculusSDK/commits/stable>

I will investigate this soon.
Such approach seems more valuable, i.e. trying to avoid a binary blob/driver.

Since our DK2 is not yet even delivered (waiting for stock ..)
I am not able to validate yet.

Maybe somebody can test when I made a patch.

~Sven



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

Re: Porting RoomTiny to Jogl

elect
Sven Gothel wrote
On 08/21/2014 09:07 AM, Sven Gothel wrote:
>
> Problem: 0.4.1 beta has no GNU/Linux version,
> plus it seems that a binary blob runtime 'dongle' is required.
>
> 'Interesting' development in the Oculus VR camp,
> and I mean - sounds sad.

There seems to be 'hacks' to enable proper DK2 detection
and maybe even the new position tracking:
  <https://github.com/jherico/OculusSDK/commits/stable>

I will investigate this soon.
Such approach seems more valuable, i.e. trying to avoid a binary blob/driver.

Since our DK2 is not yet even delivered (waiting for stock ..)
I am not able to validate yet.

Maybe somebody can test when I made a patch.

~Sven




signature.asc (828 bytes) <http://forum.jogamp.org/attachment/4032860/0/signature.asc>
Yeah, sure
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

BrickFarmer
Well I got a bit further today, but now I'm getting the following error, which sounds like either something missing on my system OSX 10.8.5? or something I need to change in the way the capabilities are picked up?  I seem to remember JOGL had some OSX specifics around this area?

java -cp dist/OculusRoomTiny.jar:lib/jogl-all.jar:lib/Jglm.jar:lib/javaUnofficialOpenglSDK.jar:lib/jna-4.1.0.jar:lib/gluegen-rt.jar:lib/jovr-0.4.1.2-SNAPSHOT.jar -Djava.library.path=lib roomTinySimplified.core.OculusRoomTiny
setupOculus()
/setupOculus()
init
Exception in thread "main-AWTAnimator" com.jogamp.opengl.util.AnimatorBase$UncaughtAnimatorException: javax.media.opengl.GLException: Caught GLException: Not a GL3 implementation on thread main-AWTAnimator
        at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:84)
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

elect
SetupOculus went fine, this means the driver/wrapper/libraries are fine :)

Regarding the gl3 error is strange.. it has to do with the animator..
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

BrickFarmer
So I changed the following to get past that strange error.

//        GLProfile gLProfile = GLProfile.getDefault();
        GLProfile gLProfile = GLProfile.get(GLProfile.GL3);
        System.out.println("got: " + gLProfile.getGLImplBaseClassName());

Next I had a complaint about shader 'texture2D' which a google search seemed to indicate might be deprecated?  I tried 'texture' instead and now now I get a black window appearing with the following error:

got: jogamp.opengl.gl4.GL4bc
setupOculus()
/setupOculus()
init
reshape (0, 0) (1296, 816)
Error 1282 !
reshape (0, 0) (1296, 816)
Error 1281 !
reshape (0, 0) (1296, 816)
Error 1281 !
Error 1281 !

I noticed the code uses shaders, but isn't the SDK responsible for that now?  Am I trying to get the wrong demo running with DK2?  Sorry if I'm asking basic questions, I just want to get something simple running with JOGL so that I can then tear it to bits and understand what approach I need for my own project :)
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

elect
BrickFarmer wrote
Next I had a complaint about shader 'texture2D' which a google search seemed to indicate might be deprecated?  I tried 'texture' instead and now now I get a black window appearing with the following error:
Which kind of complain?


BrickFarmer wrote
got: jogamp.opengl.gl4.GL4bc
setupOculus()
/setupOculus()
init
reshape (0, 0) (1296, 816)
Error 1282 !
reshape (0, 0) (1296, 816)
Error 1281 !
reshape (0, 0) (1296, 816)
Error 1281 !
Error 1281 !
This indicates something wrong with opengl

BrickFarmer wrote
I noticed the code uses shaders, but isn't the SDK responsible for that now?  Am I trying to get the wrong demo running with DK2?  Sorry if I'm asking basic questions, I just want to get something simple running with JOGL so that I can then tear it to bits and understand what approach I need for my own project :)
Yes, but I had problems to implement the SDK distorsion, so I did it by myself..

Dont worry, it is normal :)
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

jmaasing
elect wrote
BrickFarmer wrote
Next I had a complaint about shader 'texture2D' which a google search seemed to indicate might be deprecated?  I tried 'texture' instead and now now I get a black window appearing with the following error:
Which kind of complain?
Texture2D was deprecated in OpenGL 3 and I think removed in OpenGL4. OSX is a little strange nowadays in that you can get a GL2 context or a GL4 context but I've had a problems with applications that want a GL3 context (I haven't investigated why). So maybe the shader compilation complains because it is a GL4 context.
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

BrickFarmer
jmaasing wrote
elect wrote
BrickFarmer wrote
Next I had a complaint about shader 'texture2D' which a google search seemed to indicate might be deprecated?  I tried 'texture' instead and now now I get a black window appearing with the following error:
Which kind of complain?
Texture2D was deprecated in OpenGL 3 and I think removed in OpenGL4. OSX is a little strange nowadays in that you can get a GL2 context or a GL4 context but I've had a problems with applications that want a GL3 context (I haven't investigated why). So maybe the shader compilation complains because it is a GL4 context.
Yes the issue seems to be around getting a GL3 context.  This is what I think is available:

GLProfile.glAvailabilityToString()

avail: Natives[GL4bc false, GL4 false, GLES3 false, GL3bc false, GL3 true [3.2 (Core profile, arb, FBO, hardware)], GL2 true [2.1 (Compat profile, arb, FBO, hardware)], GLES2 false, GLES1 false, count 2 / 8], Common[, GL4ES3 false, GL2GL3 true, GL2ES2 true, GL2ES1 true], Mappings[GL2ES2 GLProfile[GL2ES2/GL3.hw], GL2ES1 GLProfile[GL2ES1/GL2.hw], GL2 GLProfile[GL2/GL2.hw], GL3 GLProfile[GL3/GL3.hw], GL2GL3 GLProfile[GL2GL3/GL3.hw], , default GLProfile[GL2/GL2.hw], count 5 / 12]

The original call to GLProfile.getDefault() seems to give a GL2 context.  System.out.println("got: " + gLProfile.getImplName());

A call to GLProfile.getMaximum(true)  gives GL3


got: GL3
setupOculus()
/setupOculus()
init
/roomTinySimplified/rendering/glsl/shaders/LitTexture_FS.glsl
compile status: 0
log length: 54
ERROR: 0:40: Call to undeclared function 'texture2D'

Exception in thread "main-AWTAnimator" com.jogamp.opengl.util.AnimatorBase$UncaughtAnimatorException: javax.media.opengl.GLException: Caught ThreadDeath: null on thread main-AWTAnimator
        at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:84)


This is running on a mid 2010 MBP with OSX 10.8.5 and has a NVIDIA GeForce GT 330M.  Could it be that my hardware is just too old?  But then I wouldnt expect the included DK2 demos to be working...

If I want to start from something more simple and non-shader based, what is a good test to be looking at that uses a FBO in a way similar to the new SDK approach of just passing down two textures to the SDK?
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

jmaasing
BrickFarmer wrote
This is running on a mid 2010 MBP with OSX 10.8.5 and has a NVIDIA GeForce GT 330M.  Could it be that my hardware is just too old?  But then I wouldnt expect the included DK2 demos to be working...
You can check OpenGL configuration on OSX here. https://developer.apple.com/graphicsimaging/opengl/capabilities/
 If you are on 10.8 it should support 3.2 but maybe the deprecation of Texture2D  makes it unavailable in a GL 3 Core context.
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

elect
What about texture2DRect?
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

BrickFarmer
In reply to this post by jmaasing
jmaasing wrote
You can check OpenGL configuration on OSX here. https://developer.apple.com/graphicsimaging/opengl/capabilities/
 If you are on 10.8 it should support 3.2 but maybe the deprecation of Texture2D  makes it unavailable in a GL 3 Core context.
Thanks, that clears things up, seems my hardware is OpenGL 2.1 and GLSL 1.20. Although my 2nd edition "OpenGL Shading Language" has texture2D listed as being supported in 2.0.  I haven't done much with shaders, but they seem to be supported in 2.0 so I'm going to try and back-port the demo to OpenGL 2.0
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

jmaasing
In reply to this post by elect
elect wrote
What about texture2DRect?
I don't know what that is  Maybe it is an ARB extension?
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

elect
jmaasing wrote
elect wrote
What about texture2DRect?
I don't know what that is  Maybe it is an ARB extension?
I saw it somewhere, but dont ask me the differences ^^
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

BrickFarmer
In reply to this post by BrickFarmer
I tried to port the code to GL2 and I finally got stuck with the shaders.  So my new plan is to start from scratch with GL2 and SDK based distortion, I'm determined to get something working with JOGL :)  I'm going to start a new topic because I already need a few pointers around buffer creation in JOGL.  Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Porting RoomTiny to Jogl

Sven Gothel
Administrator
On 08/26/2014 11:36 AM, BrickFarmer [via jogamp] wrote:
> I tried to port the code to GL2 and I finally got stuck with the shaders.  So
> my new plan is to start from scratch with GL2 and SDK based distortion, I'm
> determined to get something working with JOGL :)  I'm going to start a new
> topic because I already need a few pointers around buffer creation in JOGL.

I would appreciate if we could elaborate on our oculusvr binding
w/ client rendering allowing the client code handle all GL commands.

The _strong_ reason for client rendering is exactly what you have experienced,
i.e. the need of proper GL control by our code (GL profiles, etc).
I mentioned this earlier.

Maybe one could apply the mentioned changes to our SDK git repo I mentioned,
test and commit:

> There seems to be 'hacks' to enable proper DK2 detection
> and maybe even the new position tracking:
>   <https://github.com/jherico/OculusSDK/commits/stable>

This seems to be more reasonable than me doing it and relying on the roundtrip
of you testing w/ DK2.

I will validate as soon as my DK2 arrives.

~Sven

>  Thanks.


signature.asc (828 bytes) Download Attachment
12