Creating and using my own mipmap of a texture atlas

痴心易碎 提交于 2019-12-23 15:25:54

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!