问题
I'm currently using the automatic mipmap generation (C# + OpenTK):
GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
The texture I'm using is tiled into blocks of 16px². So my questions would be:
- Is it possible to use a mipmap which doesn't get downsized to 1x1?
- What would be the best way to create a mipmap which doesn't "blur" the blocks into another?
回答1:
You mean, using a mipmap chain that doesn't get up to 1x1? You can limit which levels can be used with glTexParameter, see the GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL parameters.
I don't understand your second question, if you mean using your own generated mipmaps, see the level parameter of glTexImage2D, with it you can upload your own mipmaps, filtered in any way.
来源:https://stackoverflow.com/questions/3423758/creating-and-using-my-own-mipmap-of-a-texture-atlas