#### Archived

This topic is now archived and is closed to further replies.

This topic is 6919 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Ok, I got another question, how do you do screen fades in 16 bit and higher modes? I know how to do it with 8 bit paletts, but as far as 16 bit, I haven''t a clue. Any help would be great.

##### Share on other sites
If you''re using DirectX, check out IDirectDrawGammaControl

##### Share on other sites
quote:
Original post by Squall012

Ok, I got another question, how do you do screen fades in 16 bit and higher modes? I know how to do it with 8 bit paletts, but as far as 16 bit, I haven''t a clue. Any help would be great.

... or you can also use alpha-blending doing some iterations with increasing (or decreasing) alpha values...

Bye,

Karmalaa

##### Share on other sites
Sorry to bust the rithm, but I was trying and trying to get that gammacontrol stuff to work, but it didn''t. The function just gave some ''parameter error'' back.

I suggest that you write your own (assembler) routine. It will look the same on all systems too, a problem that''s still in the gammacontrol part.

Tell me if you need an example.

##### Share on other sites
The gamma control doesn't work on some videocards (I missread some information in the SDK document when I origionaly wrote the article). Anyway you can achieve a similar fade out by using this formula.

source pixel + destination pixel / 2.

Now go through the Red Blue And Green values and use that formula.

We can speed the fade out a bit by using our brains for a moment. The overall color we want to achieve when we fade to black is 0 correct? Ok, well 0 + the source pixel color value is just going to be the source pixel value. So all we realy need to do for the fade out is to divide by 2. Now division can be a little slow there is a faster way to do this with the bitwise operators. if you right shift a number by one it will half the value. So here is what the fade out formula should look like.

newpixelcolor = sourcepixel >> 1;

Now the fade in should look something like the following.

newpixelcolor = (sourcepixel + destpixelcolor) >> 1;

Edited by - evaclear on May 9, 2000 2:45:43 PM

• 11
• 10
• 13
• 57
• 11