# Alpha Values to achieve a "dipless" crossfade

Hi

Can someone give me a bit of maths advice?

I have two surfaces which have largely similar images on them. I want to
alpha blend between the images in a seamless fashion. What is the
mathematical formula to correctly achieve this? I am theorising that I will
need some kind of logarithmic element to the alpha values.

Thanks in advance for any assistance.

Regards,

Steve**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com

Steve Lupton wrote:

I have two surfaces which have largely similar images on them. I want to
alpha blend between the images in a seamless fashion. What is the
mathematical formula to correctly achieve this? I am theorising that I will
need some kind of logarithmic element to the alpha values.

no, linear interpolation is usually sufficient, unless you have an unusual
output device

Hi

The output device is a GeForce2 MX. I am using OpenGL on top of SDL. I have
different objects in the foreground).

The alpha values of the two quads are ramped from 0.0f to 1.0f and
vice-versa. The background clearly dims towards the middle of the transition
(when both alpha values are at 0.5f)

Am I doing something really dumb?

Thanks> ----- Original Message -----

Sent: 12 February 2002 15:45
To: sdl at libsdl.org
Cc: Steve Lupton
Subject: Re: [SDL] Alpha Values to achieve a “dipless” crossfade

Steve Lupton wrote:

I have two surfaces which have largely similar images on them. I want to
alpha blend between the images in a seamless fashion. What is the
mathematical formula to correctly achieve this? I am theorising that I will
need some kind of logarithmic element to the alpha values.

no, linear interpolation is usually sufficient, unless you have an unusual
output device

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com

Hello!

Am I doing something really dumb?

Shouldn’t one of those stay intransparent?

Ciao,
Eike

Try this :

draw the back image with no alpha transparency, and the front image with an
alpha ramped from 0.0f to 1.0f . So you’ll get a fade between the back image
and the front image.

if you draw the back image with an alpha (ramped or a the middle 0.5f),
it’s blend with the background (black if you clear the screen), so the final
result is :
( (black blend with back image) blend whith front image)

-----Message d’origine-----De: Steve Lupton [mailto:SL at cre.co.uk]
Date: mardi 12 f?vrier 2002 17:00
?: 'sdl at libsdl.org
Objet: RE: [SDL] Alpha Values to achieve a “dipless” crossfade

Hi

The output device is a GeForce2 MX. I am using OpenGL on top of SDL. I have
different objects in the foreground).

The alpha values of the two quads are ramped from 0.0f to 1.0f and
vice-versa. The background clearly dims towards the middle of the transition
(when both alpha values are at 0.5f)

Am I doing something really dumb?

Thanks

----- Original Message -----
Sent: 12 February 2002 15:45
To: sdl at libsdl.org
Cc: Steve Lupton
Subject: Re: [SDL] Alpha Values to achieve a “dipless” crossfade

Steve Lupton wrote:

I have two surfaces which have largely similar images on them. I want to
alpha blend between the images in a seamless fashion. What is the
mathematical formula to correctly achieve this? I am theorising that I will
need some kind of logarithmic element to the alpha values.

no, linear interpolation is usually sufficient, unless you have an unusual
output device

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi

Thank you (and Eike).

This has solved the problem.

Apologies for the daft question.

Steve> ----- Original Message -----

From: oudin olivier (IFATEC) [mailto:oloudin@IFATEC.fr]
Sent: 12 February 2002 16:48
To: sdl at libsdl.org
Subject: RE: [SDL] Alpha Values to achieve a “dipless” crossfade

Try this :

draw the back image with no alpha transparency, and the front image with an
alpha ramped from 0.0f to 1.0f . So you’ll get a fade between the back image
and the front image.

if you draw the back image with an alpha (ramped or a the middle 0.5f),
it’s blend with the background (black if you clear the screen), so the final
result is :
( (black blend with back image) blend whith front image)

-----Message d’origine-----
De: Steve Lupton [mailto:SL at cre.co.uk]
Date: mardi 12 f?vrier 2002 17:00
?: 'sdl at libsdl.org
Objet: RE: [SDL] Alpha Values to achieve a “dipless” crossfade

Hi

The output device is a GeForce2 MX. I am using OpenGL on top of SDL. I have
different objects in the foreground).

The alpha values of the two quads are ramped from 0.0f to 1.0f and
vice-versa. The background clearly dims towards the middle of the transition
(when both alpha values are at 0.5f)

Am I doing something really dumb?

Thanks

-----Original Message-----
Sent: 12 February 2002 15:45
To: sdl at libsdl.org
Cc: Steve Lupton
Subject: Re: [SDL] Alpha Values to achieve a “dipless” crossfade

Steve Lupton wrote:

I have two surfaces which have largely similar images on them. I want to
alpha blend between the images in a seamless fashion. What is the
mathematical formula to correctly achieve this? I am theorising that I will
need some kind of logarithmic element to the alpha values.

no, linear interpolation is usually sufficient, unless you have an unusual
output device

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl