Log in or register to post comments

Flickering rendered object

November 11, 2010 - 12:46am #1

Hi,

I am wondering if this is a problem with android opengl implementation or with this SDK. As I am trying to implement my own renderer and face problems.

I tried to experiment using ImageTargets samples. Once I removed the texture binding, I can see the teapot flickering from gray to black. I tried it on both opengl es 1.1 and 2.0.

Anyone else aware of this problem?

Thanks.

CY

Re: Flickering rendered object

November 12, 2010 - 5:12am #5

There are a couple important things to understand here. The ImageTargets sample has two pathways for rendering, one using OpenGL ES 1.1, and one using OpenGL ES 2.0. The code is divided up using the #ifdef USE_OPENGL_ES_1_1 statements.

By default, the samples compile using GLES 2.0. This is a shader-based rendering system. Look at the CubeShaders.h file included in the samples/Shared/jni folder. Those are the shaders that are actually used for rendering all of the sample geometry. As you can see, the shaders are expecting a texture, so if you simply comment out the texture code the shader won't behave correctly.

If you aren't familiar with shaders, you might find it much easier working with OpenGL ES 1.1. Open the samples/ImageTargets/jni/Android.mk file, and set the USE_OPENGL_ES_1_1 flag to true. Now commenting out the texture lines should work, as GLES 1.1 uses a fixed function pipeline instead of shaders.

Let me know if you have any questions, this stuff is fairly complex if you are unfamiliar with OpenGL.

- Kim

Re: Flickering rendered object

November 12, 2010 - 3:40am #4

Yeah I see what you mean.
I get the same effect when I comment out those lines.

I'm not sure what would cause that but I'm sure its an openGL issue.
I've not worked with it for a few years now but if I find a solution I'll let you know.

Re: Flickering rendered object

November 11, 2010 - 6:12pm #3

I am fairly new to OpenGL.

Does the original ImageTargets sample have light implemented?
AFAIK, it called glDisable(GL_LIGHTING); for Opengl es 1.1.

It sure looks like lighting. Can you show how to turn them off?

I can mail you a video if you would like to see.

Thanks.

EDIT:
I just comment out the following lines from the included samples:

//glBindTexture(GL_TEXTURE_2D, thisTexture->mTextureID);
//glTexCoordPointer(2, GL_FLOAT, 0, (const GLvoid*) &;teapotTexCoords[0]);
...
//glEnableVertexAttribArray(textureCoordHandle);
//glBindTexture(GL_TEXTURE_2D, thisTexture->mTextureID);

--

CY

Re: Flickering rendered object

November 11, 2010 - 2:46am #2

Sorry I've not had this problem. When I removed the textures it was just black.

Have you implemented some sort of light source?
That could possibly turn it gray.

Log in or register to post comments