码迷,mamicode.com
首页 > 移动开发 > 详细

[工作记录] Android OpenGL ES: non-square texture - continue

时间:2014-07-19 23:09:07      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:android   blog   http   os   io   for   

previous:

[工作记录] Android OpenGL ES 2.0: square texture not supported on some device

 

recently I found that it is the mipmap of a non-square texture that cause the black texture problem:

http://stackoverflow.com/questions/5052762/using-mipmaps-results-in-garbage-textures

the texture resource data(on disk) already have mipmap chains generated,

but some textures don‘t have full mipmap chain down to 1x1. i.e. some only have 4/3 levels by configuration.

and also, we stop update mipmap on nx1 or 1xn at runtime.

this is okay on most graphics devices(PC DX9/XBOX/PC3 etc.)

but the major problem is that OpenGL ES 2.0 lacks of definition of behavior on non-square texture mipmaps(implemention defined behavior). so the GPU/drivers are free to do what they want,

for this case, they just consider a texture "in-complete" if it does have full mipmap chain(down to 1x1). So to the shader, it is just like an empty sampler bound to no textures. that‘s the reason of black textures.

 

Based on test results, this problem never happens on GLES3.0 API/devices, but happens on some GLES2.0 devices, and some devices with GLES3.0 capable hardware with 2.0 system runtime API.

[工作记录] Android OpenGL ES: non-square texture - continue,布布扣,bubuko.com

[工作记录] Android OpenGL ES: non-square texture - continue

标签:android   blog   http   os   io   for   

原文地址:http://www.cnblogs.com/crazii/p/3855512.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!