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.
我建議你評估這本書,因為它對這個主題做了相當不錯的報道.
總結
以上是生活随笔為你收集整理的android opengl es 纹理 不同设备 白色,android – OpenGL ES 2.0纹理没有在某些设备上显示...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android mvc mvp 区别,谈
- 下一篇: html怎么设置页面自适应屏幕大小,网页