Advertisement

Which is a faster: Masks or Color Keys

Started by June 20, 2000 01:46 PM
11 comments, last by Dino 24 years, 6 months ago
Well, color keying is fast and uses less RAM. It''s what gets used by hardware acceleration and DirectX''s HEL.

But like TAN mentioned... masks have the potential to be very fast. There is a document on Intel''s web site about using MMX with the masked method.

RLE has issues with clipping, but assuming that overhead isn''t too much, it is probably the fastest (not copying bytes and not doing a cmp for each transparent pixel has got to be fast).

Check out wgttut6 for one implementation of RLE. Also check out this thread for some ideas on RLE can be extended.

One method I used to speed up standard color key blts was via offsets. Generally bitmaps have a bunch of transparent rows/columns for alignment with other frames of an animation. Part of the conversion process to my own file format was to automatically crop the images down but remember the number of pixels cropped so the Blt routine would still get the right alignment.

Nathan.

Hey TANSTAAFL, hows your book comming along? I am still curious as to how you do everything. When I created my game, I developed everysingle one of my methods almost all by myself, without looking at how anyone else ever wrote tile based games (I didnt even read the stuff on gamedev), so I am still anxious to see how you did it all, so give us an update, hehe.

Possibility
Advertisement
I''ve been trying to figure out the best way to go for transparent sprites myself lately and both of the methods seem to be solid and have their own pluses.

I think I have decided to go the bitmask route just because it seems I can use that bitmask for some fast pixel level collision detection as well.

Of course I''m not planning on using that method of collision detection alone, it''ll be towards the end of a chain of tests.

Calen

~freedom
Calen~freedom

This topic is closed to new replies.

Advertisement