Alpha cost

Is setting/display a bmp with a alpha value very costly?

Yep, if you need the alpha blending, try the latest CVS snapshot, it may
be a bit faster, but alpha blending in software is generally pretty expensive.

Yorick, any luck with RLE alpha images?

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Is setting/display a bmp with a alpha value very costly?

Yep, if you need the alpha blending, try the latest CVS snapshot, it may
be a bit faster, but alpha blending in software is generally pretty
expensive.

I am using a surface that has been put into video memory, should that
improve it much?

As far as I know, there is no way to get hardware acceleration of alpha
blending without using 3D. If you put a surface into video memory, alpha
blits will be even slower as the system has to access them across the bus.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

As far as I know, there is no way to get hardware acceleration of alpha
blending without using 3D. If you put a surface into video memory, alpha
blits will be even slower as the system has to access them across the bus.

Sorry to bug everyone again, but does that mean that if I’m using a surface
that has had alpha blending applied (either from a bmp loaded in and then
applied to or a png with the alpha levels built in) I should store them in
system memory, not video memory?

Yes. :slight_smile:

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Is setting/display a bmp with a alpha value very costly?

In my game I saw in horror I was getting 25 frames per second. Before I’d
been getting the customary 59/60.

I had two bmps that moved around the screen and ‘pulsed’ by having their
alpha value changed. As soon as I removed them I jumped back up to 60
frames per second.________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

Is setting/display a bmp with a alpha value very costly?

Yep, if you need the alpha blending, try the latest CVS snapshot, it may
be a bit faster, but alpha blending in software is generally pretty
expensive.

I am using a surface that has been put into video memory, should that
improve it much?________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

As far as I know, there is no way to get hardware acceleration of alpha
blending without using 3D. If you put a surface into video memory, alpha
blits will be even slower as the system has to access them across the bus.

Ah, that would explain it. Thanks Sam.________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

As far as I know, there is no way to get hardware acceleration of alpha
blending without using 3D. If you put a surface into video memory, alpha
blits will be even slower as the system has to access them across the bus.

Sorry to bug everyone again, but does that mean that if I’m using a surface
that has had alpha blending applied (either from a bmp loaded in and then
applied to or a png with the alpha levels built in) I should store them in
system memory, not video memory?________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

As far as I know, there is no way to get hardware acceleration of alpha
blending without using 3D. If you put a surface into video memory,
alpha

blits will be even slower as the system has to access them across the
bus.

Sorry to bug everyone again, but does that mean that if I’m using a
surface
that has had alpha blending applied (either from a bmp loaded in and
then
applied to or a png with the alpha levels built in) I should store them
in
system memory, not video memory?

Yes. :slight_smile:

I was reading through the docs, and the section on SDL_CreateRGBSurface
states that:

SDL_SRCALPHA means that the surface will be used for alpha blits and (if the
hardware supports hardware acceleration of alpha blits between two surfaces
in video memory) to place the surface in video memory if possible, otherwise
it will be placed in system memory.

Doesn’t that mean that if my hardware doesn’t support alpha blits (which you
say none does, it will automatically put it in system memomory for faster
alpha blitting?________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

I was reading through the docs, and the section on SDL_CreateRGBSurface
states that:

SDL_SRCALPHA means that the surface will be used for alpha blits and (if the
hardware supports hardware acceleration of alpha blits between two surfaces
in video memory) to place the surface in video memory if possible, otherwise
it will be placed in system memory.

Doesn’t that mean that if my hardware doesn’t support alpha blits (which you
say none does, it will automatically put it in system memomory for faster
alpha blitting?

That’s correct.

If your display surface is in video memory (SDL_HWSURFACE flag) and you call
SDL_CreateRGBSurface() with the SDL_SRCALPHA flag, then SDL will check the
hardware capabilities of the video hardware and place the surface in video
memory if alpha blitting is supported, or system memory if it is not supported.

Check the flags of the returned surface to see where it was actually placed.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Doesn’t one of the Nvidia cards support alpha blitting? GeForce 256 or
GeForce II? Or is it simply that no drivers have implemented the blitting
yet?

DaveOn Wed, 5 Jul 2000, Sam Lantinga wrote:

I was reading through the docs, and the section on SDL_CreateRGBSurface
states that:

SDL_SRCALPHA means that the surface will be used for alpha blits and (if the
hardware supports hardware acceleration of alpha blits between two surfaces
in video memory) to place the surface in video memory if possible, otherwise
it will be placed in system memory.

Doesn’t that mean that if my hardware doesn’t support alpha blits (which you
say none does, it will automatically put it in system memomory for faster
alpha blitting?

That’s correct.

If your display surface is in video memory (SDL_HWSURFACE flag) and you call
SDL_CreateRGBSurface() with the SDL_SRCALPHA flag, then SDL will check the
hardware capabilities of the video hardware and place the surface in video
memory if alpha blitting is supported, or system memory if it is not supported.

Check the flags of the returned surface to see where it was actually placed.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Yorick, any luck with RLE alpha images?

Tinkered a bit, but nothing ready for release. I’m primarily concerned with
per-surface RLE blits right now; per-pixel is for later.

For some reason (maybe orthogonality) there is support for colour-keyed
blits with per-pixel alpha in SDL. I doubt that is ever used, since
it is much more intuitive to use the alpha for transparent pixels.

For some reason (maybe orthogonality) there is support for colour-keyed
blits with per-pixel alpha in SDL. I doubt that is ever used, since
it is much more intuitive to use the alpha for transparent pixels.

It was there for orthogonality.
Is anybody using this feature, or can I safely remove it?

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software