views:

44

answers:

1

I have a texture that I'd like to have relatively fine control over for the two or three largest mipmap levels, but at smaller sizes, I'm happy to have GL generate the mipmaps for me based on the smallest one that I've uploaded, on down to 1x1. Is this possible? FWIW, I'm on iPhone OS with GL ES 1.1 with this.

I've tried to enable GL_GENERATE_MIPMAP, while uploading a 128x128 and then a 64x64, but this seems to result in goofy colors (white quads) at all sizes.

Is there a way to do this? Or must I pre-generate all levels if I'm going to supply more than one?

Thanks.

A: 

According to the GL ES man pages, what you're doing should work:

GL_GENERATE_MIPMAP Sets the automatic mipmap generation parameter. If set to GL_TRUE, making any change to the interior texels of the level base array of a mipmap will also compute a complete set of mipmap arrays derived from the modified level base array. Array levels level base+1 through p are replaced with the derived arrays, regardless of their previous contents. All other mipmap arrays, including the level base array, are left unchanged by this computation.

Extracted from GL ES 1.1 man pages: glTexParameter

Are you sure your code is correct? It could be a bug in your GL ES implementation also.

Matias Valdenegro