I tried to reimplement some C based OpenGL program, with a textured terrain. The original program uses gluBuild2DMipmaps, without any problems, but when translating this into Jogl, some areas of the terrain showed artefacts, like black stripes/areas on an otherwise green grassland. Then I tried to use the OpenGL 1.4 procedures for auto-generating mipmaps, by setting GL_GENERATE_MIPMAP to true. This worked without problems! So, is this expected behaviour or is there a problem with gluBuild2DMipmaps?
These are the two code fragments:
GLU glu = new GLU();
glu.gluBuild2DMipmaps(GL.GL_TEXTURE_2D, GL.GL_RGB8, bufferedImage.getWidth(), bufferedImage.getHeight(),
GL.GL_RGB, GL.GL_UNSIGNED_BYTE, imageBuffer);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_GENERATE_MIPMAP, GL.GL_TRUE);
gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB8, bufferedImage.getWidth(), bufferedImage.getHeight(),
0, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, imageBuffer);