Hey, Atrix Wolfe [atrix2 at cox.net] was having the exact same problem!!..
Maybe you should contact him. I had replied that he should use a
method but it turned out to be a different kind of Bending (Alpha)… I
paste his own question here… (He may have solved it) Good Luck!!
Atrix Wolfe Wrote :>
I was wondering if there was a really quick way to do Additive blending
w/ or w/o light maps. Im not sure if im using the >correct terminology
so by additive blending i mean if i have a pixel on a surface that is
(50,25,150) and i want to
additive blend that with (30,30,30) i want to replace the pixel on the
surface with (80,55,180).
Right now i have a function that has a double for loop for x and y.
Inside it gets the source pixel
(either from the light map or using a constant) and then gets the dest
pixel, blends and writes the dest
I know i could do some optomizations like check and see if the source
pixel from the lightmap is completely
black not to do the blending, and also instead of having a double for
loop where it re-finds the pixel at
x,y i could get a pointer to the begining of the row on the outer loop
and just use the pointer in the inner
loop, but apart from that, is there any real good techniques to do
Thanks a bunch!
Juan Ignacio Carniglia - Programmer - Buenos Aires, Argentina.> -----Original Message-----
From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] On
Behalf Of Mike P.
Sent: Saturday, August 23, 2003 11:51 PM
To: sdl at libsdl.org
Subject: [SDL] Additive blending/Lightmaps
Hi, i currently have an additive blending effect which i
added to my game, i
wrote a function to BLIT one surface over another using
but it goes pixel by pixel in a double for loop… I was
wondering if theres
any faster way, because lots of lighting lags the hell out of
Replies will be much appreciated. heres my code:
void eng::blit_lightmap(SDL_Surface *dest, int dstx, int
dsty, int w, int h,
*source, int srcx, int srcy)
MSN 8: Get 6 months for $9.95/month.
SDL mailing list
SDL at libsdl.org