Another(!) suggestion: light level overlays

Started by stuh505, Sun 02/05/2004 16:50:43

Previous topic - Next topic

stuh505

I know this place is flooded with suggestions...but it can't hurt.  I think this one would be relatively easy to implement, and be useful in a lot of games making it worthwhile.

CreateLightOverlay(x,y,sprite,factor);

It doesn't actually use the sprite as an overlay...what it does is gets each pixel that is underneath the sprite, and increase the brightness by a linear factor of the opacity of the chosen sprite.

For instance, the sprite you use could be a white cone which dissolves into transparency.  The program would then calculate the increased brightness of all the pixels under this sprite, and then create a graphic overlay of these pixels...which could then easily be removed to revert back to the original state.

This would be useful for programming lights that turn on and off in the game.  In my game I would want this for a large room that has numerous lights which come on and off in different orders and can overlap so I can't exactly use different rooms or overlay a different image because there are too many combinations.  But i think this would be a cleaner way of doing it for simple instances as well.

Pumaman

I see what you're suggesting, but isn't it just as easy to use the region light levels and use SetAreaLightLevel to switch the light on/off?

mätzyboy

I'd suggest making a bright object (your cone for example) and then use SetObjectTransparency (int object, int amount) with an appropriate amount of transparency. Would be just about the same, wouldn't it?

stuh505

matzyboy,  I had thought of that, but wasn't expecting it to work as well.  but it does :P

GarageGothic

Hmm, I asked for something - well, not similar, but related - a while back. In my suggestion however, the overlay only affected sprites (primarily characters) and not the background. For example to project complex shadows onto the character sprite.

mätzyboy


SMF spam blocked by CleanTalk