BTW, I also found this post useful:

http://groups.google.com/group/android-developers/msg/1a785843c3f1dd8c

On Dec 24, 11:26 am, fwank <[email protected]> wrote:
> Hi Robert,
>
> So I'll describe as best I can since I do not have the Acer and
> Milestone. My customers have said the following: "Just shows white and
> black squares on my liquid", "All the graphics are white squares on my
> Milestone". Keep in mind my app runs perfect on G1, Hero, Droid, Cliq,
> et al.
>
> I have not checked OpenGL erros yet...
>
> All my textures are RGBA8888 and are of dim ^2.  I blindly followed
> some advice I found for working around the Samsung Galaxy OpenGL bug
> that probably got me into some trouble after I did a lot of
> experimentation:
>
> http://www.anddev.org/samsung_galaxy_odd_ogl_es_hardware_acceleration...
>
>  public EGLConfig chooseConfig(EGL10 egl,EGLDisplay display) {
>                int[] attributes=new int[]{
>                     //EGL10.EGL_RED_SIZE,
>                     //5,
>                     //EGL10.EGL_BLUE_SIZE,
>                     //5,
>                     //EGL10.EGL_GREEN_SIZE,
>                     //6,
>                     EGL10.EGL_ALPHA_SIZE,
>                     8,
>                     EGL10.EGL_DEPTH_SIZE,
>                     16,
>                     EGL10.EGL_NONE
>                };
>                EGLConfig[] configs=new EGLConfig[1];
>                int[] result=new int[1];
>                egl.eglChooseConfig(display,attributes,configs,
> 1,result);
>                return configs[0];
>           }
>
> Supposedly the above solved the Galaxy issue... However after reading
> more about how eglChooseConfig works I learned that if a channel is
> not specified, then it is assumed be 0 and eglChoose will return the
> lowest possible size for that channel. So I wondered how the hell the
> above worked on the G1 and Droid for me (the only android phone I
> possess). I overrode chooseConfig and logged every single
> configuration and saw that by chance that every config with an alpha
> and depth of 8 and 16 respectively also had RGB888 values. But I have
> no idea what configurations Acer Liquid support, they may have
> RGBA5658 Depth 16 for all I know, which would ruin my 3D scene since
> all my textures are RGBA8888. So I have since written my own
> implementation of choose:
>
> public EGLConfig chooseConfig(EGL10 egl, EGLDisplay d)
>                 {
>                         final int R = 8;
>                         final int G = 8;
>                         final int B = 8;
>                         final int A = 8;
>
>                         /* The best configuration that was found. */
>                         EGLConfig best = null;
>
>                         /* Temporary configurations that are found during the 
> process. */
>                         EGLConfig[] configs = new EGLConfig[100];
>
>                         /* Number of configurations found during a choose 
> configuration. */
>                         int[] result = new int[1];
>
>                         /* Desired configuration attributes. */
>                         int[] attr;
>
>                         /* Starting depth. */
>                         int depth = 24;
>
>                         /*
>                          * Search for configurations that support 24-bit 
> depth first. This
>                          * will handle the Droid case where a higher depth 
> buffer size
>                          * renders faster.
>                          */
>                         while ((depth > 4) && (best == null))
>                         {
>                                 Log.i("OGL", "Searching with depth of '"
>                                                 + Integer.toString(depth) + 
> "' bits.");
>
>                                 attr = new int[] {
>                                                 EGL10.EGL_RED_SIZE, R, 
> EGL10.EGL_GREEN_SIZE, G,
>                                                 EGL10.EGL_BLUE_SIZE, B, 
> EGL10.EGL_ALPHA_SIZE, A,
>                                                 EGL10.EGL_DEPTH_SIZE, depth, 
> EGL10.EGL_NONE };
>
>                                 egl.eglChooseConfig(d, attr, configs, 
> configs.length, result);
>
>                                 for (int i = 0; i < result[0]; i++)
>                                 {
>                                         Log.i("OGL", "   Candidate " + 
> Integer.toString(i + 1) + ":");
>                                         logConfig(egl, d, configs[i]);
>                                         Log.i("OGL", "   
> ---------------------------------------");
>                                 }
>
>                                 if (result[0] > 0)
>                                 {
>                                         best = configs[0];
>
>                                         Log.i("OGL", "Best Config: ");
>                                         logConfig(egl, d, best);
>
>                                         break;
>                                 }
>
>                                 depth -= 4;
>
>                         }
>
>                         return best;
>
>                 }
>         }
>
> I read that Droid performs best with a 24bit depth buffer,http://
> groups.google.com/group/android-developers/browse_thread/thread/
> 734a5f5d8d800ef1. So, now I search for configurations that match a
> high depth size first. The above works well on the Droid and G1.
>
> So I will likely push the above code to the market; however, I have no
> idea if it will solve all the issues. The strange thing is my app runs
> great on the Droid but shows white textures on the Milestone (the
> European Droid). I have no idea what that means...
>
> Thanks
>
> "Write once, debug everywhere"
>
> On Dec 23, 9:46 pm, Robert Green <[email protected]> wrote:
>
>
>
> > What exactly are your problems?  Are you getting any opengl error
> > codes?  When I was having problems, I was logging the dimensions of
> > each bitmap I was attempting to load, along with a call to gl getError
> > or whatever that method is that checks for errors after calling a gl
> > function.  What is your GL Config?  Are you using GLSurfaceView or are
> > you configuring GL yourself?
>
> > BTW Borsty, the Adreno graphics apps probably used ATITC compressed
> > textures which won't work on a PowerVR chip (Droid/Milestone).  That's
> > why you saw the checkerboard.
>
> > On Dec 16, 3:29 pm, fwank <[email protected]> wrote:
>
> > > Hello,
>
> > > I am having problems with OpenGL textures being displayed on the Acer
> > > Liquid and Moto Milestone. My app does a lot of OpenGL rendering on
> > > top of a camera view and runs just fine on most other phones including
> > > the Motorola DROID (very similar to the Milestone).
>
> > > I make heavy use of VBOs although I'm worried that it may be a GL
> > > surface view configuration issue. (BTW I cant find a good tutorial or
> > > documentation for selecting an appropriate graphics configuration on
> > > Android).
>
> > > Can anyone point me in the right direction?
>
> > > Thanks...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to