Monday, 17 November 2014

Nexus 10 and Android Lollipop (5) problem (Solved)

This is now address in version 1.6.0.  I like to give special thanks to Anton and Felix for helping me verifying and debugging this problem.

What is the problem?

There seems to be a bug with Nexus 10 and Android L opengl shader program implementation.  I have been using this shader program for all platforms and devices including IOS since now.  



precision mediump float;
            uniform vec4 vColor;
            varying vec2 vTextureCoord;
            uniform sampler2D sTexture;
            uniform lowp float textureMask;

            void main() {
                  gl_FragColor = textureMask * texture2D(sTexture, vTextureCoord)*vColor  + (1.0- textureMask)*vColor;
            }


 This shader program is simply for rendering any set of vertices with color and/or texture based on the "textureMask" variable.  I dont know exactly what happened internally with the driver but when rendering different vertices as color or texture the driver throw a glerror 1285 which stand for "out of memory".  However, I think the problem is because of the memory corruption when switching between texture and color.  

Case 1) To render object as pure color, I just need to pass in just the position vertices while disable the texture vertices.  

Case 2)  To render object with texture, I need to pass in both the position and texture vertices.

 What I think is that when switching from case 2 back to case 1.  The driver may not recognize that the texture vertices should be disable and potentially reference to incorrect memory.  This is my guess but it make the most sense.


The solution:


I have created two separate shaders for each purpose so there are no need for extra flag and optional parameter for the cases I described.  By breaking them into two simple shader programs I am able to bypass the driver glitch.

Lesson Learned:

Simple is better :)

------------------------------------------------------------------------------------------------------------------------------

Right now there seems to be problem running Drawexpress with the latest Android Lollipop on Nexus 10.  The problem is related to opengl issues.  I am not sure about the exact problem yet since I dont have the Nexus 10 device to test with yet. If you have a Nexus 10 please hold off on updating to Lollipop. 

If you have other devices and are having the problem loading Drawexpress after Lollipop update please email me at support@drawexpress.com.  I am also greatly appreciated if anyone with Nexus 10 who is willing to join my Android beta testing program.

- PD

18 comments:

  1. Nice information. Android is one of the most popular mobile operating system developed by Google. Learning Android Training in Chennai is useful to make a wonderful future in mobile application development field.

    ReplyDelete
    Replies
    1. Java Online Training Java Online Training Java Online Training Java Online Training Java Online Training Java Online Training

      Hibernate Online Training Hibernate Online Training Spring Online Training Spring Online Training Spring Batch Training Online Spring Batch Training Online

      Delete
    2. I have read your blog its very attractive and impressive. I like it your blog.

      Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

      Java Online Training Java Online Training JavaEE Training in Chennai Java EE Training in Chennai

      Delete
  2. Thanks for your informative article. Android SDK allows you to create stunning mobile application loaded with more features and enhanced priority. With basis on Java coding language, you can create stunning mobile application with ease. Android Training Institutes in Chennai | Android Training in Chennai

    ReplyDelete
  3. The one and only Operating system that is used widely by many around the world. Thanks for providing some useful information regarding the OS. This content was very helpful to me. Thanks for sharing. Keep blogging article like this.


    Android training in chennai | Android course in chennai | Android training center in chennai

    ReplyDelete
  4. Great blog..You have clearly explained about the concept..Step by step explanation is too good to understand..Its very useful for me to understand..Keep on sharing..
    Android training in chennai

    ReplyDelete
  5. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Web designing Course in Chennai | Hadoop Training in Chennai

    ReplyDelete
  6. Wonderful Blog with lots of useful information. Thanks for useful information. Very nice to see this post.
    Android Training in Chennai | Android Training Institutes in Chennai | Android Training Center in Chennai

    ReplyDelete
  7. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.
    Regards,
    Android Training in Chennai | iOS Training in Chennai

    ReplyDelete
  8. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Android training in Chennai | Android course in Chennai

    ReplyDelete
  9. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.
    Regards,
    Pearson Vue Exam Center in Chennai | Certification Exam Centers in Chennai

    ReplyDelete