Here are the two texture setups.
Difference is *data and hench pixFormat, And texture unite used.
bool set_texture( glSystem::program_base* image_Prog, unsigned char* img, GLint width, GLint height ){
glSystem::test_for_error("enters set_texture\n") ;
GLint texWidth=(GLint) width ;
GLint texHeight=(GLint) height ;
GLenum pixFormat=(GLenum)GL_RED ;//of pixel-data
GLenum internalFormat=(GLenum)GL_RGBA ;
GLint level=(GLint)0,border=(GLint)0;
glSystem::test_for_error("error.enters set_texture 2\n") ;
glGenTextures(1, &image_Prog->mBuffer->TBO_1);
glSystem::test_for_error("error.enters set_texture 1\n") ;
cout << "glGenTextures: " << image_Prog->mBuffer->TBO_1 << "\n" ;
sys::checkErrors("error.set img Buffer 0.8 ");
glActiveTexture(GL_TEXTURE0+1); //
sys::checkErrors("error.set img Buffer 0.9 ");
glBindTexture(GL_TEXTURE_RECTANGLE, image_Prog->mBuffer->TBO_1 );
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
sys::checkErrors("error.set img Buffer 1 ");
glTexParameteri(GL_TEXTURE_RECTANGLE , GL_TEXTURE_WRAP_S , GL_CLAMP_TO_EDGE ) ;//GL_CLAMP_TO_EDGE
glTexParameteri(GL_TEXTURE_RECTANGLE , GL_TEXTURE_WRAP_T , GL_CLAMP_TO_EDGE ) ;
glTexParameteri(GL_TEXTURE_RECTANGLE , GL_TEXTURE_MIN_FILTER , GL_LINEAR ) ;//GL_NEAREST
glTexParameteri(GL_TEXTURE_RECTANGLE , GL_TEXTURE_MAG_FILTER , GL_LINEAR ) ;
glTexParameteri(GL_TEXTURE_RECTANGLE , GL_TEXTURE_MAX_LEVEL , 0 ) ;
glTexImage2D(GL_TEXTURE_RECTANGLE, level , internalFormat , texWidth , texHeight, border, pixFormat ,GL_UNSIGNED_BYTE, img);
sys::checkErrors("error.set img Buffer 3 ");
image_Prog->mBuffer->print();
return true;
}
void setCompressedGlyphBuffer32(glSystem::program_base* glyphProg, const image::mish::col4* data){//const
GLint texWidth=(GLint)840;
GLint texHeight=(GLint)800;
GLenum pixFormat=(GLenum)GL_BGRA ;
GLenum internalFormat=(GLenum)GL_RGBA ;
GLint level=(GLint)0,border=(GLint)0;
glGenTextures(1, &glyphProg->mBuffer->TBO_1);
sys::checkErrors("set glyph Buffer 0.8 ");
glActiveTexture(GL_TEXTURE0);
sys::checkErrors("set glyph Buffer 0.9 ");
glBindTexture(GL_TEXTURE_RECTANGLE, glyphProg->mBuffer->TBO_1 );
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
sys::checkErrors("set glyph Buffer 1 ");
glTexParameteri(GL_TEXTURE_RECTANGLE , GL_TEXTURE_WRAP_S , GL_CLAMP_TO_EDGE ) ;
glTexParameteri(GL_TEXTURE_RECTANGLE , GL_TEXTURE_WRAP_T , GL_CLAMP_TO_EDGE ) ;
glTexParameteri(GL_TEXTURE_RECTANGLE , GL_TEXTURE_MIN_FILTER , GL_LINEAR ) ;//GL_NEAREST
glTexParameteri(GL_TEXTURE_RECTANGLE , GL_TEXTURE_MAG_FILTER , GL_LINEAR ) ;
glTexParameteri(GL_TEXTURE_RECTANGLE , GL_TEXTURE_MAX_LEVEL , 0 ) ;
glTexImage2D(GL_TEXTURE_RECTANGLE, level , internalFormat , texWidth , texHeight, border, pixFormat ,GL_UNSIGNED_BYTE,data);
sys::checkErrors("set glyph Buffer 3 ");
}
in main() I call functions that erects 3 program-objects. In the following order:
- simple no-texture program
- well-working glyphProg using setCompressedGlyphBuffer32(…) on tex-unit 0
- imp-program trying to set up a font-test very much like the glyphProg - on tex-unit 1
Since the validity of the very program-object seems to err, I did a rearrange of their erection-order to:
3) … the faul program
1)
2)
This made an unexpected change on the visual appearence of the working font in 2).
I do expose both data-sets used for a convolution that so far has softened both comfortably.
The new visual appearence now blurrs the font to the extreme. Looks kinda funny, but very different.
What’s that all about?