Mipmapping with jogl

Hi,

I’d like to use mipmapping with the package com.sun.opengl.util.texture.
Is the generation of mipmaps already included in the classes Texture or TextureData?
At least the TextureData class provides the method getMipmapData(), but it is unclear to me
how the mipmap data will be generated. When I call this method, the result is null.

I would be glad to get some hints for using mipmaps with jogl.

Cheers,
Jens

Yes, mipmap generation is already included; just specify “true” for the “boolean mipmap” argument to the various constructors / methods. TextureData.getMipmapData() only returns a non-NULL value for texture files which contain mipmaps (specifically, DirectDraw Surface files).

So, that means, I don’t have to care for the generation and the rendering of the mipmaps?
I’ve included the part of my rendering loop:

I load the image using the TextureIO class producing an TextureData object (to be later loaded prior to the rendering loop) with the flag for mipmapping => see (1).
Because I will later have many texture tiles I can check whether each tile is visible or not. If visible, I can create the Texture object out of the appropriate TextureData object => see (2).
Finally the texture will be rendered using mipmapping.

Would that be the implementation intended by these classes? How can I determine if mipmapping works because I currently cannot see any differences with the mipmap flag true or false?

Correct, you don’t need to worry about the mipmap generation as it’s done internally. When using mipmapping the minimization filter is GL_LINEAR_MIPMAP_LINEAR rather than GL_LINEAR; I’m not sure how to tell the difference between the two visually but there should be less aliasing when viewing far-away textured objects with mipmapping enabled.