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

本文深入探讨了在使用OpenGL ES 2.0处理非正方形纹理时,Mipmap层级不足可能导致的纹理显示问题。详细解释了纹理资源数据在磁盘上的Mipmap链已生成,但某些纹理缺少完整Mipmap链到1x1层级的原因。同时,文章指出了这种现象在部分GLES 2.0设备上存在,并在GLES 3.0 API设备上不存在的情况。此外,讨论了如何在运行时更新Mipmap以及此问题对不同图形设备的影响。

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.

i.e. some scalable UI texture only have top 4 or 3 levels on purpose.

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

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

but the major problem is that OpenGL ES 2.0 standard 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 not 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.

转载于:https://www.cnblogs.com/crazii/p/3855512.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值