1
\$\begingroup\$

Here's my dilemma : I want to have light sources placeable by the player, in terms of lanterns.

I know the best way to do this is to use pixel shaders, which I have done a lot of research and use on, but it seems so far that the lights are static.

So what would be the best method to create a dynamically lit scene?

I already have to workings of a few classes to make 2d lights (Color, Position, Type, Direction, Power) but it is just rendering that is the problem.

Thanks for your considerations!

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

You should look into Deferred Shading which is great for rendering scenes with a large amount of dynamic lights (video).

enter image description here

As for how to implement it, I recommend starting from here (courtesy of Catalin Zima and Roy Triesscheijn).

\$\endgroup\$
1
  • \$\begingroup\$ Cool, with a few tweaks I think I can modify this for 2D as well. +1. It's weird I've never come across this blog before, I searched a lot on this topic before posting and this blog never came up once! \$\endgroup\$
    – Ross
    Commented Jan 2, 2012 at 17:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .