/Niels
Transparent shadows with DirectDraw (HELP)
I dont know how to do this. Can you give me little more info (source would be nice)?
You should read the "MMX enhanced alpha blending" article. It shows how to access the Vram of the surface and reading data from it.
Bye
.. or is Starcraft 16 bit?
One of the benefits of this (if it will work for your articular application) is that the shadow data can be a part of the sprite itself, so you can save time by only blitting one surface per sprite.
Of course, that's just one way to work the issue.
-Marc
------------------
-Marc
Clan Destiny
www.mp3.com/clandestiny
Reg. how to do it, I too recommend reading that article. The "downshifting" I was talking about is this:
Asuming you have a "mask" that tells which pixels should be covered by the shadow (E.g. a black/blue picture of the shadow). You check each pixel in the mask, if it is "blue", you get the color of the corresponding destination pixel and divide each color channel (Red, green and blue) by 2, by right shifting the value, and store it again. If the mask pixel is "black" you do nothing. (Preferably the mask is a 1-bit picture to save memory, but thats a different story).
If you are running 8-bit mode, you need a mapping table that maps each of the 256 colors to its best 50% representation.
/Niels
(This IS quite sufficient, just pretty annoying that they can't tell the truth in the documentation, but rather see us waste precious time finding out for ourselves ... Doh! )
/Niels
In Starcraft to blit a unit Blizzard have two surfaces. One is a unit and the other one is shadow of that unit (which is represent in blue color - dont know why?).
I have done the same thing in my game.
I blt the blue shadow with SRCAND ( to get transparent shadow ) but thing aint working.
For example when unit is on white part of screen the shadow is normaly blue.
I have try other shadow color but it just isnt working.
Any idea what should I do or just know what I am doing wrong plese replay or mail me.
Could it be done with palletes cos I am using 8 bpp, but then I dont know how to use pallete on a single surface.
I have succeeded attaching pallete only on primary surface. Thanks