如果尚未生成MIP映射,对GL_TEXTURE_MIN_FILTER使用GL_NEAREST_MIPMAP_ *或GL_LINEAR_MIPMAP_ *是否被认为是错误的? [英] Is using GL_NEAREST_MIPMAP_* or GL_LINEAR_MIPMAP_* for GL_TEXTURE_MIN_FILTER considered erroneous if MIP maps have not been generated?

查看:301
本文介绍了如果尚未生成MIP映射,对GL_TEXTURE_MIN_FILTER使用GL_NEAREST_MIPMAP_ *或GL_LINEAR_MIPMAP_ *是否被认为是错误的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感觉这是将取决于驱动程序实现的那些情况之一,因为OpenGL规范中没有描述这种情况.但是,我希望有人会知道是否使用GL_(LINEAR/NEAREST)_ MIPMAP_ *而不会生成MIP映射与使用GL_(LINEAR/NEAREST)一样吗?

I have a feeling this is one of those situations that will depend on the driver implementation since this scenario is not described in the OpenGL specification. However, I'm hoping that someone will know if using GL_(LINEAR/NEAREST)_ MIPMAP_* without generating MIP maps would be treated the same as using GL_(LINEAR/NEAREST)?

推荐答案

是否定义没有任何活动的MIP纹理"?我不确定您会怎么做,因为没有"mip纹理"(纹理包含 mipmaps,但mipmap不是纹理)之类的东西.

Define "without any active MIP textures"? I'm not sure how you would, since there's no such thing as a "mip texture" (a texture contains mipmaps, but mipmaps are not textures).

如果您未创建完整的mipmap金字塔,则取决于您如何设置GL_TEXTURE_BASE/MAX_LEVEL.如果您正确地使用这些来告诉OpenGL您只有一个mipmap级别,那么您会没事的.如果您使用 glTexStorage 创建纹理的存储,而您只告诉它创建一个mipmap,再一次就可以了.

If you mean that you did not create a full mipmap pyramid, then it depends on how you set up your GL_TEXTURE_BASE/MAX_LEVELs. If you properly used these to tell OpenGL you only had one mipmap level, then you'll be fine. If you used glTexStorage to create your texture's storage, and you only told it to create one mipmap, again you'll be fine.

但是如果所有这些都不适用,则OpenGL默认为最不有用的东西(按照其惯常的惯用法):它将GL_TEXTURE_MAX_LEVEL级别设置为1000.这意味着它将期望您已经定义了mipmap.

But if none of those apply, then OpenGL defaults to the least useful thing (per its usual idiocy): it sets the GL_TEXTURE_MAX_LEVEL level to 1000. Which means it's going to expect you to have defined mipmaps.

根据(桌面)OpenGL,具有mipmap过滤的纹理(其中BASE/MAX_LEVEL引用未定义的mipmap)不是纹理完成". OpenGL定义针对非完整纹理进行纹理访问所获得的值为(0,0,0,1).

According to (desktop) OpenGL, a texture with mipmap filtering where the BASE/MAX_LEVELs refer to mipmaps that are not defined is not "texture complete". OpenGL defines that the value you get for a texture access against a non-complete texture is (0, 0, 0, 1).

简而言之,正确设置您的BASE/MAX_LEVEL无需担心. 总是这样做.

In short, set your BASE/MAX_LEVEL properly and you won't have to worry. ALWAYS DO THIS.

这篇关于如果尚未生成MIP映射,对GL_TEXTURE_MIN_FILTER使用GL_NEAREST_MIPMAP_ *或GL_LINEAR_MIPMAP_ *是否被认为是错误的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆