View Full Version : System memory vs. Video memory
BrewKnowC
08-01-2003, 07:59 AM
Hi, I just searched this forum and this subject was briefly touched upon, but didn't answer my question. I am in the process of optimizing the speed of my game. I am making a 2D tile game with 2-3 layers. These layers consist of base tiles, object tiles, and player/char sprites. Should all these tiles be in video memory, or system memory? I'm sorry if this seems like a stupid question, but I want to reach the lowest possible target system I can. Thanks
~Bruno
Mark Fassett
08-01-2003, 08:10 AM
In the game I'm currently working on, I have lots of frames of animation, and the only way to get it to run on an 8mb card or smaller was to put it in system memory. I decided that, instead of not being able to have it run at all, it was better to take a speed hit if necessary, but I haven't really noticed much of a speed hit, either (on a PII 400 with an 8mb ati rage pro).
What you could do is default to using system memory, but check the amount of ram on the video card and, if it's large enough, shift stuff to the card.
elund
08-01-2003, 08:28 AM
I'm using system memory for two reasons. 1) I want the game to run in both windowed and full-screen modes without having two versions of my Video class. 2) I'm starting to use more alpha transparencies in my game, which is slower to do in video memory than system memory.
jcvw75
08-01-2003, 08:31 AM
Hey, why not cache it ?
do a pure non-color key copy to a temporary buffer in
video memory, then use that buffer to colorkey to the back
buffer, so basically you still save cycles off the software
colorkeying.
Uhfgood
08-01-2003, 09:02 AM
It depends on whether or not you're using 16bit or 8bit color. If you're doing 16bit color and you want to do effects like blending and what not, then you should do it in system memory as video memory reads are very slow. If you're not doing any special effects that require 16bit color, you can go ahead and use 8 bit color in video memory, of course this limits your on screen colors and you'll have to use palettes. But it will be plenty fast enough, you can even do palette effects.
BrewKnowC
08-01-2003, 09:57 AM
I'm using 16bpp, and definitely using at least a little alpha blending right now. Thanks for all the tips. :)