Storing Sprites in Memory

Started by
1 comment, last by cyberben 23 years, 11 months ago
Hei there, I''m just going throught the logic of how the frame rendering process will go in my game. I understand that Blitting from System memory to Graphics memory is very, very slow, so If I''m assuming that people playing my game will have let''s say a minimum of a 4Mb Graphics card and my game runs in 16-bit color (IT''ll run in 3 res''s too, depending on your computer speed and resources) Then not all of my graphics will fit in Video ram anyhow, so I''m going to be blitting from system to video ram nomatter how I do it right? So Should I store ALL the sprite''s in system ram, compose the backbuffer, then blit to primary? What do you think? Any graphics guru''s got some advice for me? I''d love it!! Thanks, Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
Advertisement
Have been discussing that same issue in a few threads here recently. I''m not a graphics guru (yet), but I''ll share what I''ve learned.

quote:Original post by cyberben
So Should I store ALL the sprite''s in system ram, compose the backbuffer, then blit to primary? What do you think? Any graphics guru''s got some advice for me? I''d love it!!


Yah. This is the way to do it. Also somewhat necessary if you want do software alpha blending (not requiring a 3d card).

Sysram to Sysram is fast (optimized asm, even faster with MMX)

Video to Video is fast, and can be done at the same time as CPU, but requires Blting-capable hardware and gobs of vram

Sysram to Video is slow, minimize those.

Video to Sysram is really, really slow, never do this.

Some people have recommended that you put your user interface graphics in vram if they fit. Compose the main area of your screen in sysram and Blt it to the backbuffer (either as one Blt/BltFast, or with dirty rectangles). Then video to video Blt the few interface things to the backbuffer. And finally, do a page flip.

[someone needs to write an FAQ]

- n8



nathany.com
Thanks,
Yah I think I read the post with the guy who thought sacrificing a full screen alphablending for frame rate would be to loose quality. I think I understand, thanks, anyhow!!
Thanks again,
Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949

This topic is closed to new replies.

Advertisement