The texture I’m using has some black lines on it. They are displayed as transparent when I want them to be opaque.
The texture is loaded using:
url = c1.getResource( "com/thinkastronomy/galaxyin3d/Globular3D.png" );
globularTexture = TextureIO.newTexture( url, false, "png" );
globularTexture.bind();
gl.glTexEnvi( GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE );
That last line was an attempt get the transparency eliminated. Didn’t work.
This is how things are set up in the init() method:
gl.glShadeModel( GL.GL_SMOOTH );
// Set the background / clear color.
gl.glClearColor( 0.0F, 0.0F, 0.0F, 1.0F );
// Clear the depth
gl.glClearDepth( 1.0 );
// Disable depth testing.
gl.glDisable( GL.GL_DEPTH_TEST );
// Enable blending and specify blending function.
gl.glEnable( GL.GL_BLEND );
gl.glBlendFunc( GL.GL_SRC_ALPHA, GL.GL_ONE );
// Get nice perspective calculations.
gl.glHint( GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST );
// Nice point smoothing.
gl.glHint( GL.GL_POINT_SMOOTH_HINT, GL.GL_NICEST );
// Enable texture mapping.
gl.glEnable( GL.GL_TEXTURE_2D );
gl.glDepthMask( false );
What am I missing here? Thanks.
Bill