Hello!
I am trying to implement a ray casting algorithm in glsl. I want automatically rotate the volume, as I don’t want to implement any mouse/keyboard interaction yet.

So in order to do this, I have 2 textures: frontfaceTex, backfaceTex attached to GL_COLOR_ATTACHMENT0_EXT and GL_COLOR_ATTACHMENT1_EXT of my framebuffer. In these 2 textures I am rendering the front face and the back face of a cube.

Now, can someone please tell me what am I doing wrong in the display function, as my texture will appear only for the first time the “display” function is called? (ONLY when variable i form the above function = 0 the texture is displayed)

p.s.
When using the normal opengl way to display a texture, I get the desired result no matter how many times the “display” function is called. That’s my reason why I am posting in the Shader part of this forum
ps2
I am minimizing/maximizing the display window to get the “display” function called again… (the result is in increasing the value of i variable, rotating the cube by i degrees, and the part that it does not work, displaying the textures using glsl)
Tnx a lot for taking the time to read my long story

You don’t need to call glGetUniformLocation every frame, if you have only one program (vertex + fragment shader). call it once in your setup code (locations do not change unless You relink program object). Your problem may be located in setShaders , or releaseShaders functions, do they modify modelview/projection matrices or any attributes?

Yes, You are recompiling your shaders every frame. Do it once in setup. I’m pretty new to OpenGL, but I’ve never seen functions like glAttachProgramObjectARB. From OGL version 2.0 up shaders are in core, so You can drop ARB suffix. I use following functions to setup my shaders: