I had thought that the alpha channel was being used in my textures, but now that I have enabled depth testing, I can see that they are not. I have tried creating textures via
url = c1.getResource( "com/thinkastronomy/galaxyin3d/GalacticCore.png" );
coreTexture = TextureIO.newTexture( TextureIO.newTextureData( url, GL.GL_RGBA, GL.GL_RGBA, false, TextureIO.PNG ));
and also by the simpler
url = c1.getResource( "com/thinkastronomy/galaxyin3d/GalacticCore.png" );
coreTexture = TextureIO.newTexture( url, false, TextureIO.PNG ));
In neither case am I getting my transparent pixels blended as transparent.
I’m using
gl.glEnable( GL.GL_BLEND );
gl.glBlendFunc( GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA );
to set up blending and I’m texturing a quad.
Is there some other hidden option I need to get the alpha to work properly? It sort of looks like the alpha pixels are getting assigned the clear color, but this changes depending on what I use as the second parameter of the BlendFunc.
I suspect there is some glTexEnv*() or glTexParameter*() that I need, but it seems a pretty confusing issue and the ones I’ve tried haven’t helped.
Thanks in advance.
Bill