Thanks for the info jbw! I tried out your advice, but I still get the
black color where my transparency should be.
I double checked the png file with photoshop and gimp to make sure all
is well, and it looks ok.
My render function now looks like this:
GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GL.glEnable(GL.GL_BLEND);
GL.glDisable(GL.GL_DEPTH_TEST);
GL.glEnable(GL.GL_ALPHA_TEST);
GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
GL.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE,
GL.GL_MODULATE);
.... // draw texture 1, followed by drawing texture 2 ...
If the render function is ok, could it be that the textures are being
loaded incorrectly?
I'm a bit suspicious of the following line:
m_texture1 = new OpenGLTexture2D("myImage1.PNG");
But if I put a break point right after this line and examine the image
data of m_texture1, it appears all is well.
I'll continue to investigate, but if you or anyone has any more advice/
ideas, I'm all ears!


|