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

  • Home
  • SEARCH
  • 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 9232341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:17:27+00:00 2026-06-18T06:17:27+00:00

I’ve implemented a particle engine for a game for iPad. On the iPad Simulator

  • 0

I’ve implemented a particle engine for a game for iPad. On the iPad Simulator I get a very good framerate with >500 particles (way more than I need). On an iPad itself however, I get completely different results. With just 10 particles (I need a few more than that) I only get a very poor framerate…

As a basis I’ve taken this tutorial to implement my Particle Emitter class: http://www.71squared.com/en/article/806/iphone-game-programming-tutorial-8-particle-emitter
(uses OpenGL ES 1)

Because I use OpenGL ES 2.0, I wrote my own render method:

- (void) renderParticles:(RenderMode)renderMode ofParticleEmitter:(ParticleEmitter*)particleEmitter xOffset:(int)xoffset yOffset:(int)yoffset
{

PointSprite *vertices = [particleEmitter getVertices];

for (int p = 0; p < particleEmitter.particleCount; p++) {

    CC3GLMatrix *modelView = [CC3GLMatrix matrix];
    // Translate the Modelviewmatrix
    [modelView populateFromTranslation:CC3VectorMake(_cameraX, _cameraY, -5.0)];


    [modelView translateByX:vertices[p].x + xoffset];
    [modelView translateByY:vertices[p].y + yoffset];
    [modelView translateByZ:101.0];  

    [modelView scaleByX:2.0];
    [modelView scaleByY:2.0];

    glUniformMatrix4fv(_modelViewUniformT, 1, 0, modelView.glMatrix);

    glBindTexture(GL_TEXTURE_2D, [particleEmitter getTexture]);

    // Create and Bind a rectangular VBO
    [self calcCharacterVBOwithCols:1 rows:1 currentCol:1 currentRow:1];    

    glVertexAttribPointer(_positionSlotT, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*) 0);
    glEnableVertexAttribArray(_positionSlotT);

    // Fragment Shader value
    float opacity = 1.0;
    glUniform1f(_opacity, opacity);

    // Normal render, add Texture coordinates

    // Activate Texturing Pipeline and Bind Texture
    glVertexAttribPointer(_texCoordSlot, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid*) (sizeof(float) * 3));
    glEnableVertexAttribArray(_texCoordSlot);


    glDrawElements(GL_TRIANGLES, sizeof(IndicesLayer)/sizeof(IndicesLayer[0]), GL_UNSIGNED_BYTE, 0);

    glDisableVertexAttribArray(_texCoordSlot);
    glDisableVertexAttribArray(_positionSlotT);

    [self destroyCharacterVBO];
}
}

Did I miss some essential point on particles? What can I do better to get a better framerate on the device?

  • 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-06-18T06:17:28+00:00Added an answer on June 18, 2026 at 6:17 am

    The problem seems to have been assigning the particle texture again and again for every single particle even though they all use the same texture.

    So by binding the texture

    glBindTexture(GL_TEXTURE_2D, [particleEmitter getTexture]);
    

    before looping over all the particles I get a much faster frame rate that is comparable to the simulator.

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

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.