Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8388777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:32:47+00:00 2026-06-09T18:32:47+00:00

our live wallpaper doesn’t work properly on Motorola Atrix phone. It has a stock

  • 0

our live wallpaper doesn’t work properly on Motorola Atrix phone. It has a stock ROM w/ Android 2.3.
It looks like discard command of fragment shader doesn’t work resulting image without transparent parts.
The problem doesn’t appear on Desire S w/ Android 2.3, Mototola Droid w/ CM9, ASUS Transformer w/ 4.0, Samsung Galaxy Note w/ 4.0. So the problem seems to be very specific to Motorola Atrix phone.
We use ETC1 compressed textures so alpha channel is passed to shader via separate texture sampler – sTexture is used for main diffuse texture and sAlpha has black-and-white alpha channel.

Here is code for fragment and vertex shaders:

private final String mVertexShader = "uniform highp mat4 uMVPMatrix;\n" +
        "attribute highp vec4 aPosition;\n" +
        "attribute highp vec2 aTextureCoord;\n" +
        "varying mediump vec2 vTextureCoord;\n" +
        "void main() {\n" +
        "  gl_Position = uMVPMatrix * aPosition;\n" +
        "  vTextureCoord = aTextureCoord;\n" +
        "}\n";

private final String mAlphaFragmentShader = "precision mediump float;\n" +
        "varying mediump vec2 vTextureCoord;\n" +
        "uniform sampler2D sTexture;\n" +
        "uniform sampler2D sAlpha;\n" +
        "void main() {\n" +
        " vec4 base = texture2D(sTexture, vTextureCoord);\n" +
        " gl_FragColor = base;\n" +
        " if(texture2D(sAlpha, vTextureCoord).r < 0.5){ discard; }\n" +
        "}"; 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:32:48+00:00Added an answer on June 9, 2026 at 6:32 pm

    OK so I’ve fixed this. Many thanks to @Tim for willing to run test apps on device and providing me screenshots.
    I’ve modified fragment shader the following way:

    private final String mAlphaFragmentShader = "precision mediump float;\n" +
            "varying mediump vec2 vTextureCoord;\n" +
            "uniform sampler2D sTexture;\n" +
            "uniform sampler2D sAlpha;\n" +
            "void main() {\n" +
            " vec4 base = texture2D(sTexture, vTextureCoord);\n" +
            " vec4 mask = texture2D(sAlpha, vTextureCoord);\n" +
            " gl_FragColor = base;\n" +
            " if(mask.g < 0.5){ discard; }\n" +
            "}";
    

    It seems that Motorola Atrix OpenGL drivers treat compressed textures in wrong way and sample R channel as A channel which is always 1.0 in case of ETC1 compressed textures. It looks like internal format of texture is treated as ARGB instead of RGBA. Since my mask texture is black-and-white I can fetch any other colour. Green works just fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our company has a share point document server where the UNC looks something like
After noticing that our database has become a major bottleneck on our live production
I am using Lemonstand (an e-commerce CMS) and after going live with our site
Here is a live example: http://jsfiddle.net/Pzvdv/ <ul id=navigation> <li><a href=#>HOME</a></li> <li><a href=#>OUR APPROACH</a></li> <li><a
I've got a problem with our live server. Occasionally a page will not load,
I have a weekly script that moves data from our live database and puts
Okay, so today I updated my database with new information from our 'live' database...
Our live servers (ASP.NET) intermittently run into a mysterious error, but i cannot access
Our company is nearing its go live date (and its getting a QA department
I want to do a live video broadcast using flash. Our target is to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.