Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 787337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:11:06+00:00 2026-05-14T21:11:06+00:00

I was wondering how to speed up my iPad application using OpenGLES 2.0. At

  • 0

I was wondering how to speed up my iPad application using OpenGLES 2.0. At the moment we have every drawable object draw itself with a call to glDrawArrays(). Blend mode is on, we really need it. Without disabling blendmode, how would we improve performance for this app?

For instances, if we now draw 3 textures (1024×1024, 256×512, 256×512) across the whole screen, the app only gets 15FPS, which is really slow I think? Are we doing something terribly wrong? Our drawing code (for each drawable), is as follows:

- (void) draw {
    GLuint textureAvailable = 0;
    if(texture != nil){
        textureAvailable = 1;
    }

    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_2D, texture.name);

    glVertexAttribPointer(ATTRIB_VERTEX, 2, GL_FLOAT, 0, 0, vertices);
    glEnableVertexAttribArray(ATTRIB_VERTEX);

    glVertexAttribPointer(ATTRIB_COLOR, 4, GL_FLOAT, 1, 0, colorsWithMultipliedAlpha);
    glEnableVertexAttribArray(ATTRIB_COLOR);

    glVertexAttribPointer(ATTRIB_TEXTUREMAP, 2, GL_FLOAT, 1, 0, textureMapping);
    glEnableVertexAttribArray(ATTRIB_TEXTUREMAP);

    //Note that we are NOT using position.z here because that is only used to determine drawing order
    int *jnUniforms = JNOpenGLConstants::getInstance().uniforms;
    glUniform4f(jnUniforms[UNIFORM_TRANSLATE], position.x, position.y, 0.0, 0.0);
    glUniform4f(jnUniforms[UNIFORM_SCALE], scale.x, scale.y, 1.0, 1.0);
    glUniform1f(jnUniforms[UNIFORM_ROTATION], rotation);
    glUniform1i(jnUniforms[UNIFORM_TEXTURE_SAMPLE], 0);
    glUniform2f(jnUniforms[UNIFORM_TEXTURE_REPEAT], textureRepeat.x, textureRepeat.y);
    glUniform1i(jnUniforms[UNIFORM_TEXTURE_AVAILABLE], textureAvailable);

    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}

Possible optimizations I think won’t work:

  • Drawing geometry in batches
    • I’m only drawing 3 items and the FPS is 15, I don’t think batching the geometry would work here because it’s such a small number of calls for drawing that it doesn’t matter if we kill 2/3 of those calls.
  • Texture Atlas
    • Again, only drawing 3 textures. What I do wonder if it would matter (a lot) if we were to convert these to PVR? I haven’t looked into it, but I must admit we’re loading big PNGs at the moment. Is there any way to see if this is indeed the case, or is it easier just to check it out?

But please tell me if I’m wrong, I’m happy to hear any ideas.

Proposed solutions

Mipmapped textures

Loading mipmapped textures, doing it like this:

- (id) initWithUIImage: (UIImage * const) image {
    glGenTextures(1, &name);
    //JNLogString(@"Recieved name(%d), binding texture", name);
    glBindTexture(GL_TEXTURE_2D, name);

    //Set the needed parameters for the texture
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); 
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

    //Load the image data into the texture

    glGenerateMipmap(GL_TEXTURE_2D);

    return self;
}

This doesn’t seem to do anything for our FPS, I think this is because our textures are already roughly at the size they are rendered to on the screen, in most cases even 1:1.

Other solutions are welcome! I will try them out and post the results here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:11:07+00:00Added an answer on May 14, 2026 at 9:11 pm

    I had a branch in my fragment shader. I though that didn’t put a lot of strain on it, but it did! Anyhow, that was the whole problem, I removed the branch and now my FPS has almost doubled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im wondering about speed optimization in PHP. I have a series of files that
I'm wondering if using by AsParallel would speed up my code in the way
I'm primarily wondering what the speed difference is in accessing the object cache of
I've written an app using OpenGL-ES 1.1, but am wondering if there are speed
I'm trying to speed up my SELECT queries in my web application. I have
I was wondering it there was a way to throttle inbound connection speed using
Wondering if I can speed up the search. I need to build a functionality
I was wondering if writing to the LogCat affects the speed of the device
Wondering if someone could help me. I have next to no knowledge with Ajax,
I was wondering if it was possible to speed up this MySQL query. Currently,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.