Big Performance Hit!!

Started by
19 comments, last by fallingbrickwork 21 years, 7 months ago
Hi all, I am currently writing a simple `Space Invaders` type game and wanted a nice colourful space type background behind all the action. I thought of using a texture mapped QUAD... How wrong was I?! The frame rate of the game is fine until I turn on this QUAD. It then drops dramatically!! As the QUAD is sitting behind all the action it has to be very big to appear to fill the screen, is this what is slowing the frame rate?? Is it not a good idea to use very big QUADS?? How would you display a nice colourful background? I didn''t think using ONE large QUAD would have such an effect of the FPS! Many thanks, fallingbrickwork.
Advertisement
It''s quite possible you''re fillrate limited. Just how significant is the performance hit?

I think adding a skybox to my program using immediate mode calls ate about 30 FPS (a 10% performance drop), but that wasn''t crucial since I hadn''t optimized yet. Anyway, point is that you''re gonna get a performance hit, and if it''s too extreme to be acceptable, you''ll have to find a better way to do it.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[twitter]warrenm[/twitter]

I''m not sure of the exact FPS performance drop, I''m purely looking at the results from a gamers point of view. It is a noticable drop in frame rate. As this is my first attempt at a complete game, I''m not sure whether what I am finding un-acceptable is just me being picky. You mention "I hadn''t optimized yet". How/What did you look at to try and squeeze a few more FPS out of your project? How else could I achieve a textured background? Would splitting the QUAD into 4 smaller textured QUADS help or would the overall performance hit equal-out in the end?

Cheers,
fbrickwork.
Well, a triangle strip is faster than a quad. You should get used to using those first.
glBegin(GL_TRIANGLE_STRIP);
// input verticies in this order
// 1-2
// |/|
// 3-4
glEnd();
What''s the resolution on your texture? See how small you can get the image without losing too much quality.

How old is your graphics card? Comp speed? It does sound like you''re just slaughtered with the fillrate.

------------
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155
"It''s all part of the conspiracy of conspirators conspiring to conspire their own conspiracies..."
_______________________________________Pixelante Game Studios - Fowl Language
you can draw your background at a greater z coordinate after you draw all opaque objects on screen, thus saving on fillrate.
Thats odd, when I implemented a skybox, my fps actually went up by about 30...

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
The resolution of the Texture is 256x256.

Does rendering foreground objects before background objects affect rendering performance or not?

How do I implement a `skybox`?

Am I right in saying that this is a large textured cube that sits around your game world?? If this is so, wouldn''t rendering a complete cube cause more of a performance hit than 1 QUAD?
Also, as a furthar performance enhancement: providing the quad is the first thing you render, you can turn off Z-buffer writes and checking, then render the Quad. Then render everything else.

[edited by - MrWugga on September 3, 2002 5:28:40 AM]
Hi all,

With regards to Mr.Wugga''s comment on `Turning off the z-buffer`, it sounds like a good idea. I was just searching good ole `google` on z-buffering etc and found this:

---------------------------------------------------------------
Z-Buffer and the Freedoms
Curiously, turning on Z-buffering allows the Freedoms to perform much faster than with it off. This is because when Z-buffering is on, OpenGL allows the system to draw primitives in any order it wants, and not in the order the user specified them. This liberty allows the Freedoms to distribute primitive drawing among its processors, providing much better performance.
---------------------------------------------------------------

What does anyone think about this? Is the above correct?
I''ll try turning off the z-buffer 2nite and see if I get any FPS increase.

Cheers.
One thing that kills performance ( and how I got a 30fps increase using a skybox ) is clearing the colour buffer bit. Don''t do it.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.

This topic is closed to new replies.

Advertisement