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 8056811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:49:55+00:00 2026-06-05T08:49:55+00:00

I am developing a game where similar objects are rendered on the screen. The

  • 0

I am developing a game where similar objects are rendered on the screen. The problem is that every time a new object is added, more vertices needs to be handled, so FPS decrease.

Since I am a beginner with openGl, I have some general ideas about improving performance, I just don’t know what openGl allows me to do.

  1. Since most of my objects are identical(same number of vertices, same colors, same uvs and same normals), but only the position and rotation of the objects are different, is it possible to send the vertices for similar objects only once, on each frame render , and then call drawElements for all objects and modify only the objects positions?

  2. Is it possible to go even further, and upload those similar vertices, only once when the scene is 1st created, and on each frame render just call drawElements for each object?

Currently, I am sending the vertices for each object like this:

.......
gl.glNormalPointer(GL10.GL_FLOAT, 0, normals);
gl.glColorPointer(4, GL10.GL_UNSIGNED_BYTE, 0, colors);
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertices);
gl.glPushMatrix();
gl.glTranslatef(position);
gl.glRotatef(rotation);
gl.glScalef(scale);    
gl.glDrawElements(renderType,nr,GL10.GL_UNSIGNED_SHORT, faces);
gl.glPopMatrix();
........

I am thinking I should do someting like this:

.......
gl.glNormalPointer(GL10.GL_FLOAT, 0, normals);
gl.glColorPointer(4, GL10.GL_UNSIGNED_BYTE, 0, colors);
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertices);
for(eachObject)
{
gl.glPushMatrix();
gl.glTranslatef(position);
gl.glRotatef(rotation);
gl.glScalef(scale);
gl.glDrawElements(renderType,nr,GL10.GL_UNSIGNED_SHORT, faces);
gl.glPopMatrix();
........
}
  • 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-05T08:49:57+00:00Added an answer on June 5, 2026 at 8:49 am
    1. Yes
    2. Yes (even better)

    Your second code example looks exactly like what you should be doing.

    There’s no reason you’d need to upload the vertices more than once, doing it on initialization should be sufficient. After that just set the pointers any time you want to render. You can call glDrawElements as many times as you want with different translations/rotations.

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

Sidebar

Related Questions

I'm developing a game with cocos2d and box2d. The problem is that sometimes my
I am currently developing an Android game that is similar to a classic arcade
I'm developing game. I store my game-objects in this map: std::map<std::string, Object*> mObjects; std::string
i am developing game.i am displaying gun object center bottom of the screen.when user
I am developing an web application which is similar to the popular mobile game
I'm developing a line drawing game, similar to Flight Control, Harbor Master, and others
I am developing a game using Cocos2d FrameWork in Android. I encountered a problem
I have been developing a game in the HTML5/Javascript new canvas feature, and all
I am developing game editor in C# that uses c++ lib files. I want
Ok, the cards game I'm developing is pretty similar to Scopa if someone knows

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.