Android Mixing OpenGLES 1.0 and OpenGLES 2.0 - android

I've been asked to create shaders for our Android engine and I'm a little confused. So far the engine has been built on the premise that we use GL10 instances to be responsbile for the drawing of everything. But because shaders are OpenGL 2.0 if I were to set the context client version to 2.0 and draw a simple scene (say a cube) nothing appears whereas it does if I use the default 1.0.
I'm not entirely sure how I should proceed - do I need to create different engines based on the highest level version of OpenGLES supported by the device? Use the higest possible regardless of what it can support (assuming backward compatibility)?
Any help/suggestions appreciated...

OpenGL ES 2.x is not backward compatible with OpenGL ES 1.x. You have to write different code to support both of them.

Related

Is there an Android implementation of JOGL's GL2ES2?

JOGL includes several interfaces that represent the common features of various versions of OpenGL and OpenGL-ES.
Is there an Android implementation of the GL2ES2 interface somewhere in one of the JOGL packages, or do I have to bite the bullet and implement it myself?
You should read this documentation:
http://jogamp.org/jogl/doc/Overview-OpenGL-Evolution-And-JOGL.html
JOGL 2 already works as is under Android. What are you trying to do? Numerous tablets and mobile phones support OpenGL-ES.
Imagine that you want to launch a Java program using JOGL on my Samsung Galaxy S3 4G i9305. It supports both OpenGL ES 1 and OpenGL ES 2, it will pick the former or the latter depending on how you create your GL profile. If it picks OpenGL ES 2, GLContext.getCurrentGL() will return a GLES2 instance. GLES2 is a subinterface of GL2ES2. What's the matter with that?

Android OpenGL ES 2.0: Do I need to check if VBOs are supported before using?

I want my code to perform well in all devices supporting Es 2.0. In my code, I am using VBOs, reading documentation reveals that it requires the implementation of extension "GL_ARB_vertex_buffer_object".
However, glGetString(GL_EXTENSIONS) does not list the above mentioned extension string for the device I am using (Samsung Tab) though it supports it.
To my knowledge, the VBO extension is only meant for OpenGLES 1.1. OpenGLES 2.0 supports this by default. This tutorial, which I consider one of the best, makes no consideration to test the device before running the VBOs.
In all my Android apps I use OpenGL ES 2.0 with VBO without any additional checks.
And VBOs work on Galaxy Tab.
In OpenGLES2 you do not have to check for VBO extension.
In OpenGLES2 you do have to check for vertex_array_object if you want to use VAO as well.
Here is a database of extensions from various devices.

Can we use non-power-of-2 textures on OpenGL ES on Android?

Does anyone know if it is possible to use NPOT textures on Android's OpenGL ES renderer?
Yes, for OpenGL ES 2.0, NPOT textures are supported in the core specification with some limitations in wrap modes, and 3D textures. The limitations are lifted when using the GL_OES_texture_npot extension.
For OpenGL ES 1.x, there is no extension to support NPOT textures.
It appears that Froyo does has a NPOT implementation for OpenglES 1.1. However, so far I can not get UI to displace with proper aspectio. I think Froyo has issue with this implemenation, based on a quick review of the code. Gingerbread has updated a better design like Apple's method, but I can get Gingerbread to work yet. I am having very hard time making Android to work for HW ES 1.1 that needed NPOT work-around. Has any one out there got NPOT to work with HW Opengl 1.1 with Froyo/Gingerbread ?
Jimmcwin

Difference in iOS OpenGl ES and Android OpenGl Es

I am wondering what the difference (if any) there is in OpenGl ES for Android and OpenGl ES for iOS
OpenGLES API for Android have many unsported API and any problems.
For instance, glColorub, glPointParameterfv, point sprite OES(Extension) APIs, and so on.
And, Xpreia(android device) have glFlush bug.
When glFlush used, occurred display noise.
OpenGLES API for Android implementation is asunder each devices.
There is no difference. The OpenGL ES 1.x and 2.x are available on most phones. Many mobile GPU have specific extensions but if you don't use them, iOS or Android can share same code. OpenGL is a C API, so the Java One provided by Android is specific.
Our games share the same code for iOS and Android. Only the EGL(Android) and AGL(iOS) parts are different. For performance reason, we use some specific extensions (Compressed Textures...).

Getting started with OpenGL... in Android

I'm an experienced Android developer (if such thing exists) who has never worked with OpenGL before.
There are various advantages of the Android platform (open-source, open distribution, portable, and so on) that make me think that it might be a great environment to finally get into OpenGL.
But I'm also worried that the complexity of working in a environment with limited resources might be too much for someone who has never worked with 3D graphics before. Also, it seems that Android only uses a subset of OpenGL, and I don't know how this will affect my learning experience.
What do you think? Is Android OpenGL development newcomer-friendly, or for experienced OpenGL developers only?
There's not really an "Android OpenGL", it's just OpenGL ES 1.1 or OpenGL ES 2.0, which IS a subset of OpenGL, but oriented to mobile and embedded devices.
I don't think any platform is "newcomer-friendly", is just that you need to get the necessary knowledge to use it. For OpenGL/OpenGL ES, you need to have certain computer graphics knowledge before trying to use it. GL ES and GL are very similar and GL ES knowledge also works in GL (not viceversa, since it's a subset), so just get into it.
I recommend the book OpenGL ES 2.0 Programming Guide (for GL ES 2.0) and the book OpenGL ES Game Development for OpenGL ES 1.1. These books are in C, you need to "port" them to Java, since Android uses that, but the basics are the same.

Categories

Resources