SFML community forums

Help => Graphics => Topic started by: yparghi on June 28, 2015, 07:19:38 pm

Title: Simple lighting effects: should I use shaders or plain SFML code?
Post by: yparghi on June 28, 2015, 07:19:38 pm
I'm writing a 2D pixel art game in SFML and I want to add some simple mood lighting effects, such as a fluorescent lamp hanging overhead, or a glowing button on a computer console. Any thoughts on using OpenGL shaders vs. plain SFML/C++ code to do this?

I figure I could implement lighting well enough in SFML using overlaid textures and blend modes and my own pixel-crawling logic. Then I wouldn't have to worry about learning GLSL, graphics card compatibilities, avoiding "deprecated" features like gl_FragColor, etc. etc. Performance is probably not an issue since my game is visually simple.

But maybe someone with more experience knows reasons I should suck it up and use a proper shader. Any thoughts on these general approaches? Thanks for input.
Title: Re: Simple lighting effects: should I use shaders or plain SFML code?
Post by: Nexus on June 28, 2015, 07:29:40 pm
No need to reinvent the wheel... Have a look at the Let There Be Light (http://en.sfml-dev.org/forums/index.php?topic=16895.0) library 8)
Title: Re: Simple lighting effects: should I use shaders or plain SFML code?
Post by: yparghi on June 28, 2015, 11:43:23 pm
Thanks for the link. Looks like that library uses shaders, so I'll take that as an implicit vote for "use shaders" (and maybe that library)