Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Simple lighting effects: should I use shaders or plain SFML code?  (Read 3972 times)

0 Members and 1 Guest are viewing this topic.

yparghi

  • Newbie
  • *
  • Posts: 24
  • Maker of the adventure game K Station
    • View Profile
    • K Station
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.
K Station: An adventure game of disappearing lives | Out now on Steam! | Twitter @yashparghi

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Simple lighting effects: should I use shaders or plain SFML code?
« Reply #1 on: June 28, 2015, 07:29:40 pm »
No need to reinvent the wheel... Have a look at the Let There Be Light library 8)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

yparghi

  • Newbie
  • *
  • Posts: 24
  • Maker of the adventure game K Station
    • View Profile
    • K Station
Re: Simple lighting effects: should I use shaders or plain SFML code?
« Reply #2 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)
K Station: An adventure game of disappearing lives | Out now on Steam! | Twitter @yashparghi