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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:47:33+00:00 2026-06-01T00:47:33+00:00

I’m currently developing a Touhou-esque bullet hell shooter game. The screen will be absolutely

  • 0

I’m currently developing a Touhou-esque bullet hell shooter game. The screen will be absolutely filled with bullets (so instancing is what I want here), but I want this to work on older hardware, so I’m doing something along the lines of this at the moment, there are not colors, textures, etc. yet until I figure this out.

glVertexPointer(3, GL_FLOAT, 0, SQUARE_VERTICES);
for (int i = 0; i < info.centers.size(); i += 3) {
    glPushMatrix();
    glTranslatef(info.centers.get(i), info.centers.get(i + 1), info.centers.get(i + 2));
    glScalef(info.sizes.get(i), info.sizes.get(i + 1), info.sizes.get(i + 2));
    glDrawElements(GL_QUADS, 4, GL_UNSIGNED_SHORT, SQUARE_INDICES);
    glPopMatrix();
}

Because I want this to work on old hardware I’m trying to avoid shaders and whatnot. The setup up there fails me on about 80 polygons. I’m looking to get at least a few hundred out of this. info is a struct which has all the goodies for rendering, nothing much to it besides a few vectors.

I’m pretty new to OpenGL, but I at least heard and tried out everything that can be done, not saying I’m good with it at all though. This game is a 2D game, I switched from SDL to Opengl because it would make for some fancier effects easier. Obviously SDL works differently, but I never had this problem using it.

It boils down to this, I’m clearly doing something wrong here, so how can I implement instancing for old hardware (OpenGL 1.x) correctly? Also, give me any tips for increasing performance.

  • 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-01T00:47:34+00:00Added an answer on June 1, 2026 at 12:47 am

    Also, give me any tips for increasing performance.

    If you’re going to use sprites….

    1. Load all sprites into single huge texture. If they don’t fit, use several textures, but keep number of textures low – to avoid texture switching.
    2. Switch textures and change OpenGL state as infrequently as possible. Ideally, you should set texture once, and draw everything you can with it.
    3. Use texture fonts for text. FTGL font might look nice, but it can hit performance very hard with complex fonts.
    4. Avoid alpha-blending when possible and use alpha-testing.
    5. When alpha-blending, always use alpha-testing to reduce number of pixels you draw. When your texture has many pixels with alpha==0, cut them out with alpha-test.
    6. Reduce number of very big sprites. Huge screen-aligned/pixel-aligne sprite (1024*1024) will drop FPS even on very good hardware.
    7. Don’t use non-power-of-2 sized textures. They (used to) produce huge performance drop on certain ATI cards.

    glTranslatef

    For 2D sprite-based(that’s important) game you could avoid matrices completely (with exception of camera/projection matrices, perhaps). I don’t think that matrices will benefit you very much with 2D game.

    With 2d game your main bottleneck will be GPU memory transfer speed – transferring data from texture to screen. So “use as little draw calls” and “put everything in VA” won’t help you – you can kill performance with one sprite.

    However, if you’re going to use vector graphics (see area2048(youtube) or rez) that does not use textures, then most of the advice above will not apply, and such game won’t be very different from 3d game. In this case it’ll be reasonable to use vertex arrays, vertex buffer objects or display lists (depends on what is available) and utilize matrix function – because your bottleneck will be vertex processing. You’ll still have to minimize number of state switches.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I need a function that will clean a strings' special characters. I do NOT
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
I would like to count the length of a string with PHP. The string

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.