   strange behavior of FBO and texture, viewport
  Hello,there is a problem with the FBO that I dont understand. I set up an FBO and attached a texture to it. For this example lets assume a texure size of 256*256 and the viewportis some bigger value lets say 1400 * 1200;Here the FBO works fine.[cpp]fbo.bind();glPushAttrib(GL_VIEWPORT_BIT);glViewport(0,0,tex->getWidth(), tex->getHeight());glDrawBuffer(GL_COLOR_ATTACHMENT0);glClear(GL_COLOR_BUFFER_BIT);drawCube();glPopAttrib();fbo.unbind();glslSimpleTex.bin();glslSimpleTex.setSampler("texture", GL_TEXTURE_2D, tex->getId(), 0);drawQuad();glslSimpleTex.unbind();[/cpp]But if I do the following, I see just an empty quad exceptwhen the fbo texture is as large as the window viewport.I dont understand whats the difference here to the exampledescribed abov ?[cpp]fbo.bind();glPushAttrib(GL_VIEWPORT_BIT);glDrawBuffer(GL_COLOR_ATTACHMENT0);glClear(GL_COLOR_BUFFER_BIT);glslRaycastSimple.bind();glslRaycastSimple.setSampler("entryPoints" GL_TEXTURE_2D, tempImage->getId(), 0);glslRaycastSimple.setSampler(string("exitPoints"), GL_TEXTURE_2D, exitPoints->getId(), 1);glslRaycastSimple.setSampler(string("volume"), GL_TEXTURE_3D, volumeGL->getVolumeTex()->getId(), 2);glslRaycastSimple.setUniform2f(string("screenReciproc"), 1.0f/float(canvas->getScreenWidth()), 1.0f/float(canvas->getScreenHeight()));glslRaycastSimple.setUniform1f(string("stepWide"), 0.002f);drawCube();glslRaycastSimple.unbind();glPopAttrib();fbo.unbind();glslSimpleTex.bind();glslSimpleTex.setSampler("texture", GL_TEXTURE_2D, tex->getId(), 0);drawQuad();glslSimpleTex.unbind();[/cpp]regards,c-mos   
  I solved the problem, but I don't know why it's working.It's crazy.Ok, the vertex shader just passes the vertex position bygl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;In the fragment shader I do the following to get texture coordinatesfrom the vertex. The vertices are from 0,0,0 to 1,1,1So i dovec2 texc  = gl_FragCoord.xy * screenReciproc; where screenReciproc is 1.0f/windowWidth, 1.0f/windowHeight.But If I change this line vec2 texc  = gl_FragCoord.xy * screenReciproc; to thisvec2 texc = (gl_TexCoord[0].xy / gl_TexCoord[0].w + 1.0) / 2.0;It works. And if I use this old linevec2 texc  = gl_FragCoord.xy * screenReciproc; and pass for screenReciproc 1.0f/256, 1.0f/256then it works as well.Thats what I dont understand.I only render certain stuff into a texture. What went wrong ?regards,c-mos