[Working record] Android OpenGL Es:non-square texture-continue

Source: Internet
Author: User

Previous

[Working record] Android OpenGL ES 2.0:square Texture not supported on some device

Recently I found that it's 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 has mipmap chains generated,

But some textures don ' t has full mipmap chain down to 1x1. i.e. some only has 4/3 levels by configuration.

And also, we stop update mipmap on NX1 or 1xn at runtime.

This was okay on the most graphics devices (PC DX9/XBOX/PC3 etc.)

But the major problem was that OpenGL ES 2.0 lacks for definition of behavior on Non-square texture mipmaps (implemention def ined behavior). So the gpu/drivers is free-to-do-what they want,

For the this case, they just consider a texture "in-complete" if it does has full mipmap chain (down to 1x1). So to the shader, it's just like a 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 de Vices with GLES3.0 capable hardware with 2.0 system runtime API.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.