Login  Register

Re: Porting RoomTiny to Jogl

Posted by BrickFarmer on Aug 25, 2014; 12:05pm
URL: https://forum.jogamp.org/Porting-RoomTiny-to-Jogl-tp4032722p4032924.html

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?