From: Alban C. <aco...@mi...> - 2002-03-07 10:08:18
|
Hello, I finally found out I was mistaken loading alpha channel, and as usual this gl4java is made by too damn good programmers !!! I was in fact using a dangerous approach specifying the image format with hard coding : gl=2EglTexImage2D(gl=2EGL_TEXTURE_2D,0,3,texLoader=2EgetImageWidth(),texLoad= er=2Eget ImageHeight(),0, gl=2EGL_RGB ,gl=2EGL_UNSIGNED_BYTE,texLoader=2EgetTexture= ()); And there was my mistake, I had two functions loading textures, and didn't figure the one my program was using was the one with GL_RGB hard coded ! So when loading a RGBA image, it was in fact considered as RGB and my pixels were all messed up=2E A much smarter approach is to let the loader decide of the format of the file, replacing GL_RGB by texLoader=2EgetGLFormat() So a smart glTexImage2D function looks like this : gl=2EglTexImage2D(gl=2EGL_TEXTURE_2D,0,3,texLoader=2EgetImageWidth(),texLoad= er=2Eget ImageHeight(),0,texLoader=2EgetGLFormat(),gl=2EGL_UNSIGNED_BYTE,texLoader=2E= getTex ture()); Hope this can be usefull for everybody, Regards, Alban Cousini=E9 http://www=2Emind2machine=2Ecom tel : +33 491 246 734 fax : +33 491 246 702 |