PDA

View Full Version : Graphics...


DBZ-GOKU-
Dec 11, 2002, 11:51 PM
Hey, can one of you Astraware \"workers\" I guess tell me how I would do the graphics for the game that are \"see-through-able?\" What I mean is, say youi have a background. How would you make it so you could have another screen over it that makes it a darker shade, but you can still see the background. Can you tell me how to do that?

Howard
Dec 12, 2002, 12:17 AM
Well, its not clear exactly which you\'re asking about, but here\'s both.

(*) Masking. This is where you have something which has areas which are either entirely transparent, or completely opaque in a particular colour. This is achieved by having a separate image (called the mask) which you use with a set of mathematical operations (AND/OR/NOT etc) to blank out an area in the destination to entirely white or black. (Depends which method you will be using).
Then, you perform another operation between the source image and the destination. Because you have some areas of the source image completely black (or white, it depends), then you combine them to fit into the area that you just cut out.


(*) Transparency. More often known as alpha blending. This is done similarly, but instead of a simple \'yes/no\' mask, you have a mask which specifies a level (0-255) by which to blend the source with the destination. Zap!2016 does this for the star field against the logo in the title screen, where you see them fade in or out.

Transparency is generally not done in paletted screen modes, because the calculations are horrid. (Generally involving big lookups).

Transparency in 24 bit is quite easy. In 16 bit its still not too bad, although you have to be careful where its 5,6,5 or something else for the colour structure.

Of course, all that blending is very CPU intensive. Even just masking is quite expensive compared to a straight BLIT which just copies all of the source over the destination.

Lots of web resources for this - but I thought giving you a quick pointer to how it works might be appreciated!

Howard.

DBZ-GOKU-
Dec 12, 2002, 04:53 AM
Thanks Had, sounds complicated so I will just leave it out. :)