Optimization

Started by
18 comments, last by Sneftel 17 years, 11 months ago
"improvement of around 20 FPS" is pretty much meaningless as a metric. What is your FPS before and after?
Advertisement
S3 Graphics ProSavageDDR

Screen: 800x600; 32 bits
Texture: 6400x2400; 32 bits

I guess the texture is huge, but I don't see how I could make it smaller without doing an ugly repeat. Maybe I could create a parallax effect so it wouldn't have to reach the edges of the screen.
That is a friggin' huge texture for a skybox. What's actually IN the texture? Most skies are limited to low-frequency features.
This is a 2D essentially sidescrolling game. The texture covers the background of the entire level. It is basically the Earth's surface as viewed from a very high altitude.
Aren't many old-ish graphics cards limited to 1024x1024 for textures? If so, that'll really reduce the amount of people who can use your game. Why do you kneed such a high-res sky box?

Edit: Ahh.. I'd try breaking it up into chuncks then. It shouldn't be that much work, either.
Quote:Original post by Mr Awesome
This is a 2D essentially sidescrolling game. The texture covers the background of the entire level. It is basically the Earth's surface as viewed from a very high altitude.

Then you should (a) break it into screen-sized chunks, and (b) scale it down to about 512x512 texels per screen.
Okay, sorry, stupid mistake. The actual texture is 1024x1024 (with only 800x600 actually used), but it is blown up to cover 16 times that space.
As Sneftel has said, giving the before and after FPS would help.

So at the moment, you are drawing a 6400x2400 quad, with a 1024x1024 texture, but only using 800x600, so your texture co-ordinates are 0,0-800/1024,600/1024. Then to scroll, you're translating the quad? Correct?

If that is what you're doing, you might change it a bit. Use an 800x600 quad, and alter the texture co-ordinates. You could also try to enable the scissor test.

Note however that your card is pretty old, and even in it's day it wasn't the best preformer. This could account for unexpectedly poor performance. Do you have the latest drivers for regardless?
Various S3 Savage information via Wikipedia

Edit: What's the rest of your system like too? CPU and Mem? I think this is a review involving your card, or a close relative, and it's getting about 60FPS at 800x600 16-bit in Quake 2. If I remember rightly, that was a time when the 32-bit performance of a card was noticably worse than 16-bit, if it offered 32-bit at all.
Yes, my card is fairly poor as graphics cards go (I think). Without rendering, my FPS was 60, but then dropped to 30 and below when I rendered stuff. So actually there was a 50% drop in framerate when I started rendering stuff. I think 60 FPS is extremely slow for what I'm doing, but I'm definitely not an expert programmer.

However, I optimized the graphics a little by shrinking the textures to 256x256, flattening them to one texture, and only displaying an 800x600 quad on the screen at any one time. It actually looks better now, since you wouldn't expect the Earth's surface to appear to move with you at all from that distance. It really gives the effect of a racetrack suspended high in the atmosphere, which looks great and boosts my FPS back up to 40 (along with a small optimization on the track surface). Any other ideas for optimization?
Well, there are two strategies you can use for backgrounds; one is occasionally better for old cards, the other is better for new cards. The first method is to render the background first, with Z-testing and Z-writing both disabled. That'll reduce the load on the Z-buffer. The second method is to render the background last, with Z-testing enabled and Z-writing disabled. That'll reduce the load on the framebuffer, and will also reduce the load on texture memory and pixel processors if the card does early Z testing (your card, I am nearly certain, does not). Try both these strategies. Also consider WHOSE card you should be optimizing for.

This topic is closed to new replies.

Advertisement