Jump to content
  • Advertisement
Sign in to follow this  
Hachaso

OpenGL Opengl ES 1.1 Performance problems

This topic is 3163 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I have been experimenting with my HTC Magic, running Android 1.5. I created a Cube, where all the faces have different textures. The textures are of size 512x512. The cube is scaled so the plane facing the screen takes up the whole screen. This give me a performance around 20 fps. I think that it's pretty damn slow. I had around 12 - 15 fps before but improved it by using VBO's. What else could I do to boost up performance. If I only create 1 plane that takes the whole screen, using a texture of 512x512, it should give me atleast over 30 fps, am I right? Please helps.

Share this post


Link to post
Share on other sites
Advertisement
Does your phone have 3D hardware acceleration? If it doesn't, a software rasterizer replaces it, which is slow.

Share this post


Link to post
Share on other sites
When I only use 1 texture on the Cube.
I get 36 fps.

When running with a 2x2 sized texture I get 60 fps.
I also get a lot of
D/dalvikvm( 101): GC freed 9861 objects / 516968 bytes in 429ms
When rendering.

Share this post


Link to post
Share on other sites
If GC == Garbage Collector and it's freeing things ~every few frames, make sure you're not dynamically allocating anything that doesn't need to be. VBOs? Verts/texcoords? Texture objects? Textures? You do just load the textures at startup and not every frame, right?

Other than that:
Is mipmapping enabled and are they being generated properly?

Does changing the sampling mode (GL_NEAREST, GL_LINEAR, etc.) change things drastically?

Share this post


Link to post
Share on other sites
This is practically my draw code.

      GL11 gl11 = (GL11) gl;
// draw using hardware buffers
gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, PlaneVertBufferIndex1);
gl11.glVertexPointer(3, GL10.GL_FIXED, 0, 0);

gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, textureCoordBufferIndex);
gl11.glTexCoordPointer(2, GL11.GL_FIXED, 0, 0);

gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, indexBufferIndex);

gl11.glBindTexture(GL10.GL_TEXTURE_2D, textures[2]);

gl11.glDrawElements(GL11.GL_TRIANGLES, 6, GL11.GL_UNSIGNED_SHORT, 0);


gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, PlaneVertBufferIndex2);
gl11.glVertexPointer(3, GL10.GL_FIXED, 0, 0);

gl11.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);

gl11.glDrawElements(GL11.GL_TRIANGLES, 6, GL11.GL_UNSIGNED_SHORT, 0);


gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, PlaneVertBufferIndex3);
gl11.glVertexPointer(3, GL10.GL_FIXED, 0, 0);

gl11.glBindTexture(GL10.GL_TEXTURE_2D, textures[1]);

gl11.glDrawElements(GL11.GL_TRIANGLES, 6, GL11.GL_UNSIGNED_SHORT, 0);


gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, PlaneVertBufferIndex4);
gl11.glVertexPointer(3, GL10.GL_FIXED, 0, 0);

gl11.glBindTexture(GL10.GL_TEXTURE_2D, textures[3]);

gl11.glDrawElements(GL11.GL_TRIANGLES, 6, GL11.GL_UNSIGNED_SHORT, 0);


gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, 0);


I removed the top and bottom planes from the cube since I didn't need them for what I'm testing.
I have also tested to call gl11.glBindTexture(GL10.GL_TEXTURE_2D, 0);
on 2 of the planes to speed up performance.

Is it correct to do it like this?

What if I want to be able to change the textures on the planes when it rotates. Like it would be a list?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!