OpenGL-两种纹理的功效 [英] OpenGL - Power Of Two Textures

查看:217
本文介绍了OpenGL-两种纹理的功效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OpenGL使用二次幂纹理. 这是因为由于MipMapping,某些GPU仅接受2的幂.当绘制大于其的纹理时,使用这些2的幂的纹理会导致问题.

OpenGL uses power-of-two textures. This is because some GPUs only accept power-of-two textures due to MipMapping. Using these power-of-two textures causes problems when drawing a texture larger than it is.

我曾想过一种解决此问题的方法,即仅在我们使纹理小于实际大小时使用PO2比率,而在使纹理更大时使用1:1比率,但是这是否会造成某些GPU的兼容性问题?

I had thought of one way to workaround this, which is to only use the PO2 ratios when we're making the texture smaller than it actually is, and using a 1:1 ratio when we're making it bigger, but will this create compatibility issues with some GPUs?

如果有人知道是否会发生问题(我无法检查这一点,因为我的GPU接受NPO2纹理),或者有更好的解决方法,我将不胜感激.

If anybody knows whether issues would occur (I cannot check this as my GPU accepts NPO2 Textures), or a better workaround, I would be grateful.

推荐答案

您的信息已过时.自OpenGL-2(2004年发布)以来,就支持任意尺寸的纹理.所有现代GPU都很好地支持NPOT2纹理,并且没有任何明显的性能损失.

Your information is outdated. Arbitrary dimension textures are supported since OpenGL-2, which has been released in 2004. All contemporary GPUs do support NPOT2 textures very well, and without any significant performance penality.

不需要任何解决方法.

这篇关于OpenGL-两种纹理的功效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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