如何在 OpenGL 中禁用 mipmap
我正在 OpenGL 中制作 2D 精灵引擎,并且我想禁用 mipmap,因为我不需要它们。
当我调用:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, internal->internal_w, internal->internal_h, 0, GL_RGBA, GL_UNSIGNED_BYTE, internal->data);
RenderWithThisTexture();
我得到了白色矩形,但是当我调用:
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, internal->internal_w, internal->internal_h, GL_RGBA, GL_UNSIGNED_BYTE, internal->data);
RenderWithThisTexture();
我得到了正确纹理的矩形
时,我发现这可能是因为启用了 mipmap,但遗憾的是我找不到任何信息如何禁用它们。
我想坚持使用 OpenGL 1.1(不是 OGL 2.0 或更高版本的代码)
I am making 2D sprite engine in OpenGL and I want to disable mipmaps, as I do not need them.
When I call:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, internal->internal_w, internal->internal_h, 0, GL_RGBA, GL_UNSIGNED_BYTE, internal->data);
RenderWithThisTexture();
I got white rect, but when I call:
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, internal->internal_w, internal->internal_h, GL_RGBA, GL_UNSIGNED_BYTE, internal->data);
RenderWithThisTexture();
I got the properly textured rect
I figured out that this may be because of enabled mipmaps, but sadly I can't find any info how I can disable them.
I want to stick with OpenGL 1.1 (not OGL 2.0 or above code)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该是默认值。确保您没有将其更改为
MIPMAP
某处。This should be the default. Make sure you are not changing it to
MIPMAP
somewhere.