android opengl es 纹理 不同设备 白色,android – OpenGL ES 2.0纹理没有在某些设备上显示...

早上好,这是2个纹理非幂的典型例子.

由于多种原因,纹理在分辨率上需要2的幂,这是一个非常常见的错误,每个人都碰巧陷入这个陷阱:)我也是.

2个纹理的非功率在某些设备/ GPU上运行平稳的事实,仅仅取决于OpenGL驱动程序实现,一些GPU清楚地支持它们,其他一些不支持,我强烈建议你选择pow2纹理以便能够保证所有设备的功能.

最后但并非最不重要的是,使用2个纹理的非强大功能可能会让你在GPU内存利用率方面陷入困境,因为大多数接受非powerof2纹理的驱动程序需要在内存中将纹理重新缩放到最接近2因子的更高功率.例如,具有520X520的纹理可能导致1024X1024的实际存储器映射.

这是你不想要的东西,因为在现实世界中“大小很重要”,特别是在移动设备上.

你可以在OpenGL Gold Book中找到一个很好的解释,OpenGL ES 2.0:

In OpenGL ES 2.0, textures can have non-power-of-two (npot)

dimensions. In other words, the width and height do not need to be a

power of two. However, OpenGL ES 2.0 does have a restriction on the

wrap modes that can be used if the texture dimensions are not power of

two. That is, for npot textures, the wrap mode can only be

GL_CLAMP_TO_EDGE and the minifica- tion filter can only be GL_NEAREST

or GL_LINEAR (in other words, not mip- mapped). The extension

GL_OES_texture_npot relaxes these restrictions and allows wrap modes

of GL_REPEAT and GL_MIRRORED_REPEAT and also allows npot textures to

be mipmapped with the full set of minification filters.

我建议你评估这本书,因为它对这个主题做了相当不错的报道.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值