Archived

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

ncsu121978

alpha blending

Recommended Posts

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