G1 and OpenGL ES

Problems with Canvas, OpenGL, etc...

G1 and OpenGL ES

Postby tariqm » Fri Nov 07, 2008 6:12 am

Hi.

I was wondering if the G1 supports OpenGL ES fully or not.

I was testing the 3d cube apps that came with the ApiDemos package, and found that only the Kube class worked. The other two examples, "GLSurfaceView" and "TranslucentGLSurfaceView" did not work on my G1.

They worked find on the emulator, but just not on the T-Mobile G1 phone.

I cannot find any information regarding the G1 and OpenGL ES. All I can tell is that the G1 seems to support certain aspects of OpenGL ES and not others.

As always, any help would be appreciated :D

-Tariq
tariqm
Freshman
Freshman
 
Posts: 6
Joined: Fri Nov 07, 2008 6:00 am

Top

Postby alpesh_harsoda » Mon Nov 17, 2008 10:28 am

hiiiiiii
can u share ur code so i can help if possible.
thnks,
Alpesh
User avatar
alpesh_harsoda
Senior Developer
Senior Developer
 
Posts: 106
Joined: Sat Sep 20, 2008 12:35 pm
Location: Rajkot,Gujarat(India)

Postby tariqm » Mon Nov 17, 2008 3:22 pm

http://www.pragprog.com/titles/eband/source_code

Well here's a professional example from a book.
I attached the exact project.

I'm having problems with all textures using my G1. The textures look fine in the emulator, but when running the program on the G1(HTC Dream) I have problems.

If anyone can test the cube project attached and see if they have a texture showing up I'd appreciate it.

I tried about 4 other projects, and my own project and have the same problem with each one.


Thanks alpesh_harsoda

Note: The attached is not mine, it is an example from book "Hello, Android"
Attachments
OpenGL.zip
(16.36 KiB) Downloaded 362 times
tariqm
Freshman
Freshman
 
Posts: 6
Joined: Fri Nov 07, 2008 6:00 am

Postby alpesh_harsoda » Tue Nov 18, 2008 7:13 am

hi tariqm,

i have checked that code its running well.sry but i m not getting why its not run in htc means your mobile.
thnks,
Alpesh
User avatar
alpesh_harsoda
Senior Developer
Senior Developer
 
Posts: 106
Joined: Sat Sep 20, 2008 12:35 pm
Location: Rajkot,Gujarat(India)

Postby tariqm » Tue Nov 18, 2008 10:48 pm

It is not just a rotating white cube when you tested it on the HTC Dream?

Can anyone else verify the scene that is created when running on the HTC Dream, G1?

I still keep getting a white twirling cube. I hope it's not a hardware problem...
tariqm
Freshman
Freshman
 
Posts: 6
Joined: Fri Nov 07, 2008 6:00 am

Postby jjamminjim » Thu Nov 27, 2008 6:41 am

I've verified this on my G1. Texture is missing in the device, renders perfect in the emulator.

I have a similar problem with textures created from bitmaps loaded from resource, and mutable bitmaps that are rendered dynamically.

Is there a solution to this issue?
jjamminjim
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Nov 27, 2008 6:36 am

Top

Postby tariqm » Thu Nov 27, 2008 3:24 pm

Thank you jjamminjim for verifying this! :D

I wonder why it was not mentioned more often. Seems like a BIG deal.
I'm sure some developer out there is making a 3D game is is going to find out that the texture dose not show up.
I hope it's a software issue and not something hardware related...

Can anyone else verify if the texture issue is a problem with a select few G1s or if the problem is with all G1s?

jjamminjim, I have not yet found a solution to this problem...
I was creating a 2d game, but rendering it in OpenGl for speed, but am now using the Android Graphic classes.
Hopefully this dilemma can be solved soon, before I release my game. Want it to be as quick as possible :).

-TariqM
tariqm
Freshman
Freshman
 
Posts: 6
Joined: Fri Nov 07, 2008 6:00 am

Postby bostonskipper » Sun Nov 30, 2008 6:36 am

The example is bad, the textures need to have a resolution that is a power of 2 according to spec. (64x64, 128x128, etc). The texture in the example provided is 90x90. If you scale it to either 64x64 or 128x128, it works on a G1. So its not that the G1 is broken, but the emulator shouldn't have rendered the texture in the first place as its not to spec.

Cheers and good luck.
~/)~ Stay the course.
bostonskipper
Freshman
Freshman
 
Posts: 2
Joined: Sun Nov 30, 2008 6:30 am
Location: Boston

Postby tariqm » Sun Nov 30, 2008 3:32 pm

Hey bostonskipper thank you!

It works now.

I am so relieved! :D

Thought I was going to have to replace my G1 or something.
The problem seems so obvious, I posted in many forums and no answer.

If I may ask bostomskipper, where is this "spec" located at?

I was just following example code from the examples included in the SDK and the book.
And was following code from online OpenGL tutorials.
tariqm
Freshman
Freshman
 
Posts: 6
Joined: Fri Nov 07, 2008 6:00 am

Postby bostonskipper » Sun Nov 30, 2008 4:32 pm

The OpenGL ES 1.0 spec is maintained by the Khronos group

The reference manual can be found here
http://www.khronos.org/opengles/1_X/1_0/
http://www.khronos.org/registry/gles/sp ... manual.pdf

The section you are looking for describes the parameters "width" and "height" for glTexImage2d method, page 145 as numbered by the document, page 149 as numbered by the pdf.

height must be 2^n + 2*border
width must be 2^m + 2*border
border must be 0

Hope this helps.
~/)~ Stay the course.
bostonskipper
Freshman
Freshman
 
Posts: 2
Joined: Sun Nov 30, 2008 6:30 am
Location: Boston

Postby MrSnowflake » Sun Nov 30, 2008 4:57 pm

bostonskipper wrote:height must be 2^n + 2*border
width must be 2^m + 2*border
border must be 0
So basically height = 2^n :).
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby tariqm » Sun Nov 30, 2008 6:43 pm

bostonskipper I really appreciate all your help.

Looking and the specs now.
My 2d game is now running using OpenGl ES on my phone!

The docs at the Khronos group website are much more helpful than androids documentation on OpenGl ES.
tariqm
Freshman
Freshman
 
Posts: 6
Joined: Fri Nov 07, 2008 6:00 am

Re: G1 and OpenGL ES

Postby Merrymerry » Sat Sep 15, 2012 11:44 pm

Well, you must seek an expert idea from the people living in your vicinity, as is always easy to find the solution for technical solution after seeing it personally.
Regards,
balinese hut
Merrymerry
Freshman
Freshman
 
Posts: 3
Joined: Sat Sep 15, 2012 11:36 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 2 guests