I’m working on a custom renderer using JOGL. It uses several geometric passes to set up input data, followed by a final pass using a fullscreen quad and a fragment shader to finish the job. I have recently been trying to use a border on my 3D texture in an attempt to get rid of some drawing artifacts. The 3D texture is referenced by the shader, but is not directly mapped onto the fullscreen quad.
My current problem is that upon starting up, my program initializes, and runs most of the code to render the first frame, then stalls before finishing that frame, and no further rendering occurs. It seems related to my recent 3D texture changes, as I am able to get the renderer back by disabling my (attempted) use of a texture border. I have isolated the stall, and am certain that it occurs at the glVertex call for the 4th vertex of the fullscreen quad in my final rendering pass (the only pass that uses the 3D texture & the shader that refers to it). By “stalling”, i mean that it appears as if my glVertex() call is blocking indefinately.
Can anyone offer some insight as to why my texture border attempt has offended it? ???
The 3D texture data is loaded into vData.greyscaleData (a ByteBuffer), and padded with a 1 byte zero valued border on all 3 dimensions, then loaded into a texture object with this code:
gl.glBindTexture(GL.GL_TEXTURE_3D, texHandles[t_GREYSCALE_DATA]);
gl.glTexParameteri(GL.GL_TEXTURE_3D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
gl.glTexParameteri(GL.GL_TEXTURE_3D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
gl.glTexParameteri(GL.GL_TEXTURE_3D, GL.GL_TEXTURE_WRAP_R, GL.GL_CLAMP);
gl.glTexParameteri(GL.GL_TEXTURE_3D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP);
gl.glTexParameteri(GL.GL_TEXTURE_3D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP);
if(GREYSCALE_TEX_BORDERS)
vData.addBorders();
gl.glTexImage3D(GL.GL_TEXTURE_3D,0,GL.GL_INTENSITY,vData.xDim,vData.yDim,vData.zDim,
GREYSCALE_TEX_BORDERS?1:0,GL.GL_LUMINANCE,GL.GL_UNSIGNED_BYTE,
vData.greyscaleData);
I have checked and rechecked that i am rewinding my buffers; is there something else obvious that i’m missing?
Hope someone knows what the deal is. :-\