Jump to content
Posted 18 July 2012 - 09:05 PM
Posted 19 July 2012 - 08:24 AM
Fly Safe 7o
Posted 19 July 2012 - 11:43 AM
Edited by mrbastard, 19 July 2012 - 11:44 AM.
Posted 19 July 2012 - 01:50 PM
No need to use OpenGL - though it will certainly open up lots more possibilities. Alpha blending will do what you need in plain SDL.
Assuming your art assets were created looking like they are lit up, at runtime you actually want to darken everything that's not under the light.
I suggest experimenting with blended layers in a paint program until you get the effect you want (hint - additive or multiplicative), then work out how to set up blending in SDL to reproduce your chosen effect.
Posted 19 July 2012 - 06:43 PM
I "surf" the web, literally.
Posted 20 July 2012 - 09:21 AM
Posted 20 July 2012 - 12:31 PM
I think it could be relatively simple. If the camera follows your character in a fixed center point you could overlay the rendering with an image that has a transparent center point which fades into black around the edges. You could even make this a sprite and animate it slightly for a closer feel of having a torch lighting the zone.
Then I suppose you could calculate the distance of your character and other objects to provide the illusion that they are essentially appearing within the viewport area.
Posted 20 July 2012 - 11:33 PM
Yea I was thinking of doing this but if I wanted more then one torch I would have trouble