Jump to content
  • Advertisement

Archived

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

djsteffey

alpha blending

This topic is 6604 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

How would I do alpha blending in 8 bit mode ? C++, MSVC 6, DirectX 7 I saw lots of tutorials for 16 bit blending but nothing on 8 bit...... "Now go away or I shall taunt you a second time" - Monty Python and the Holy Grail themGames Productions

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You would probably make a look up table (LUT) since it''s a palatized mode. Arrange the LUT by approximate RGB values. Then when you''re doing blending search the LUT and find the closest color match to the one you want. Cheers!

Share this post


Link to post
Share on other sites
Ncsu,

Dont use Look-Up tables, i dont say it's will not work, but the effect will be Crapy !!

The way, i do it, is rendering a image at 32bits simply cause it's faster then 24bits. Once you got you final picture in memory; Find the colors that are the most use in your image (this will need a algorithm). Then just convert your TrueColor picture to an Indexed Color's one.

The effect will be a lot better. Cause you will only used the most used color.


Happy Coding ...

LowRad

Edited by - LowRad on June 20, 2000 12:23:48 PM

Share this post


Link to post
Share on other sites
That would be awfully slow.
Let''s say that the app is running in 800x600 that would be 480000 pixels.
So every frame you have to lock your surface have a loop that runs 480000 times and read and write to every pixel.
This is not possible if you wan''t a good framerate.

Share this post


Link to post
Share on other sites
Sure, that''s 480000 (or whatever) pixels, but only if you''re alpha blending the whole screen! That''s not common. For a small 64x64 or 32x32 sprite -- which is far more likely -- the expense may relatively small and unnoticeable. Just my $.02!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!