Jump to content
  • Advertisement
Sign in to follow this  
Prupel

Rendering lots of stuff OpenGL 1.x style

This topic is 2248 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

Hello!

I'm creating a touhou-esque game and I can't seem to efficiently render things on the screen. I'm expecting a few hundred, even a thousand objects on screen, and for everything I try I seem to start lagging after 50 or so (vertex arrays, immediate mode).

I'm making this game using entirely vector graphics and stuff I draw myself with vertices. I know about instancing, a little about shaders. I'm trying to use OpenGL 1.x so this can work on older hardware. Any tips or references for me? I would appreciate it a lot!

The goal is to render 1000+ objects on screen using OpenGL 1.x without lag.

Sorry for having my first post a "halp!" post! sad.png

Share this post


Link to post
Share on other sites
Advertisement
Depends on the complexity of each object. Even immediate mode can handle thousands of quite simple objects per-frame without measurable performance decrease, if done right (glBegin/glEnd pairs moved to outside loops, sort by state, etc).

You should also define your "older hardware" target more clearly. If "older hardware" means including anything more than 10 years old, then your approach is valid; if it doesn't then your approach is probably not - for most hardware within the past 10 years you can safely assume some kind of shader/VBO support (OpenGL 2.0 dates to 2004 and D3D9 is even older - 2002 - and while lower level hardware did exist for a time afterwards, by 2006 or thereabouts everything was settled down, with the exception of some integrated Intels). In 2012 VBOs and shaders should no longer be considered any kind of risky new technology; they're ubiquitous.

Share this post


Link to post
Share on other sites
Problems with 50 objects? Without knowing more it's difficult to tell but it is very suspicious.
Or perhaps not. The whole problem with original vertex arrays in GL is that they save CPU power only. Instead of doing a [font=courier new,courier,monospace]Vertex [/font]call for each vertex (and then [font=courier new,courier,monospace]Normal[/font], and [font=courier new,courier,monospace]TexCoord[/font], and whatever), one is able to put a whole set of completely defined vertices in a single call.
This is insufficient: all the data will still have to travel from client-side to GPU.
I strongly suggest to consider VBOs like mhagain is proposing.
If this is not a possibility (I hardly believe it isn't), display lists might help.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!