Jump to content
  • Advertisement

Archived

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

Squall012

Screen fades

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!