SFML community forums

Help => General => Topic started by: Clockwork on August 29, 2013, 03:42:07 am

Title: Curious About Lighting
Post by: Clockwork on August 29, 2013, 03:42:07 am
Hey everybody!

I saw all of the Game Jam entries and had a stroke of inspiration.  I want to get a relatively simple lighting system ready that I might be able to use for some future projects.  I found this tutorial that would be perfect for what I would like, but it's written in an earlier version of SFML (1.6 I think).

(Link) http://www.facepunch.com/threads/showthread.php?t=1011659

Is this a relatively good system for lighting and if so, how would I convert it to SFML 1.6?  The majority of it works, but the stuff like sf::Shape::Line does not.

It doesn't really matter though, any 2D lighting system would be appreciated!

Thank you! :D
Title: Re: Curious About Lighting
Post by: Lo-X on August 29, 2013, 08:45:03 am
I don't have the code here at work but that's where I adapted my lighting system, from which I took just one or two things for my Jam game.

In y memories adapting that code for sfml 2 is really easy.

Concerning if it is the best way to do it, I don't know. You can manage nice number of lights before the fps drops, but some guys around here use shaders and you can probably have more lights like that.
Title: Re: Curious About Lighting
Post by: Nexus on August 29, 2013, 11:06:47 am
There is an interesting library, Let There Be Light (http://en.sfml-dev.org/forums/index.php?topic=6635), and its successor GLLight2D (http://en.sfml-dev.org/forums/index.php?topic=11939). You can either directly use it, or take a look at its source code for inspiration :)
Title: Re: Curious About Lighting
Post by: Clockwork on August 29, 2013, 03:42:12 pm
Wow, that's really cool!

That's exactly what I was looking for, thanks guys.  ;D