Fade out effect

Discuss game and other programming topics not specifically covered in another forum

Moderator: Programming Moderators

User avatar
Duefectu
Posts: 7
Joined: Sun May 10, 2020 9:41 am
Location: Mallorca (SPAIN)
Contact:

Fade out effect

Postby Duefectu » Sun May 24, 2020 4:20 pm

Is there any way to make a fade out effect.
I try to work setting palette colors, but.
Is possible to read the actual color palette?
Any sample of fade in/out?

Sorry for my bad English!

dave18
Posts: 186
Joined: Tue May 30, 2017 1:06 am
Location: Bristol, UK

Re: Fade out effect

Postby dave18 » Sun May 24, 2020 4:22 pm

Yes, you can read the palette, port 41 gets you the 8 msbs and port 44 gets you the lsb if you using 9 bit colour.

User avatar
SevenFFF
Posts: 565
Joined: Mon Jun 05, 2017 5:30 pm
Location: USA

Re: Fade out effect

Postby SevenFFF » Sun May 24, 2020 4:34 pm

A common algorithm is to read each palette colour, split into arm red, green and blue components (in the Next, each RGB channel can Have values between 0..7), reduce each channel by one, clamping at zero, reassemble the palette value, then rewrite it. Repeat until everything is zero.

A variation of this algorithm looks at the starting value for each palette, and proportions the amount each channel is reduced by according to this, so that everything reaches zero at the same time.

Another variation will fade to a specific 9 bit RGB colour, which is just a general version of the second variant.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins

Ped7g
Posts: 256
Joined: Mon Jul 16, 2018 7:11 pm

Re: Fade out effect

Postby Ped7g » Mon May 25, 2020 6:57 pm

Fade-out example for Layer2 320x256 mode:
https://www.facebook.com/groups/Spectru ... 799543638/ (FB link with video in action)

NEX file + Source code + README:
https://github.com/ped7g/ZXSpectrumNext ... er2FadeOut

User avatar
Duefectu
Posts: 7
Joined: Sun May 10, 2020 9:41 am
Location: Mallorca (SPAIN)
Contact:

Re: Fade out effect

Postby Duefectu » Sun Jun 28, 2020 7:24 am

Awesome!

Thanks!


Who is online

Users browsing this forum: No registered users and 3 guests