I use the following to render a texture font to an fbo(which I later render to another fbo):
glViewport(0, 0, width, height);
glOrtho(0f, width, height,0f, -1f, 1f);
glClear(GL_COLOR_BUFFER_BIT); // (0f,0f,0f,0f)
glWrite(0f, i*16f, line);
glViewport( 0, 0, vPort, vPort);
With the above code all the letters miss the right 4 pixels. The letters appear in full when gldisable is commented out. Why is this? (the letters are on the same pixels both ways)
glWrite just needs an x, y and a line (char) and works like a charm everywhere except on that fbo when blending is disabled.
glWrite is alike nehe’s texture font write function.
What could disabling blending do to make part of the letters(textures) not show up?
Why the 4 pixels still showed up is still a mystery to me, but here the solution:
In stead of glDisable(GL_BLEND), using glBlendFunc(GL_ONE,GL_ONE) worked like a charm
What does disabling blending exactly do? does set rendering to ignore the alpha channel?
When you disable blending, newly computed fragments color will replace the last fragments color stored in the framebuffer. When you enable blending, incoming fragments color can be blended with the fragment color that are already in the framebuffer using the operation set with glBlendFunc.
Using GL_ONE as source and destination will add the incoming fragment color to the one already stored in the framebuffer. You may quickly obtain saturated renderings.
If you use glBlendFunc(GL_ONE,GL_ZERO) it would behave as if blending is disabled.
Ok, this is how I thought it would work.
Is there anything special in this regard when rendering to fbo-binded textures to other fbo’s?
= clipped letters, (GL_ONE, GL_ONE) works correct…
I must be doing something really stupid