hello
i am trying to manually generated mipmaps to work. with no success. the idea is basically the same as it can be found in the ‘red book’.
when i set
GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST_MIPMAP_NEAREST);
to
GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
i can at least see the first of the mipmaps. probably because mipmapping is turned of then.
i was wandering if anyone has ever successfully done this kind of mipmapping and could help me out with a code snip or correct my mistake.
cheers
d3
TextureReader.Texture[] texture = new TextureReader.Texture[6];
try {
for (int i=0; i<texture.length; i++){
texture[i] = TextureReader.readTexture(“demos/data/images/”+i+".png");
}
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST_MIPMAP_NEAREST);
for (int i=0; i<texture.length; i++){
gl.glTexImage2D(GL.GL_TEXTURE_2D,
i,
GL.GL_RGB,
texture[i].getWidth(),
texture[i].getHeight(),
0,
GL.GL_RGB,
GL.GL_UNSIGNED_BYTE,
texture[i].getPixels());
}