SFML community forums
Bindings - other languages => DotNet => Topic started by: jcsnider on January 30, 2015, 11:27:57 pm
-
Hello everyone!
I am working on a small 2D game engine, right now I am specifically focused on map lighting. My current code makes use of a dark render texture, adds each light to it with BlendMode.Add and then renders that over the gamescreen with BlendMode.Multiply. It works well.
(http://puu.sh/feuk1/1de1f63218.jpg)
How I am aware that there are alternative and possibly more optimized methods to accomplishing a similar effect. Possibly with shaders? (Which I have almost no understanding of.) One thing I really don't care for is the overlapping of lights creating the venn diagram effect.
Anyone here have any tips or possible examples of better methods to achieve this effect?
Thanks,
JC
-
Why would you search alternatives to a solution which works well, is simple to implement and gives more than good performances?
-
Because he doesn't like the "Venn diagram" effect, I guess ;-)
-
This is how real lights works, though. Two lights lighting the same area by the same amount cause it to be twice as bright.
Adding greater fall-off to the lights could help.
-
Because he doesn't like the "Venn diagram" effect, I guess ;-)
He said "I really don't care" about it.
-
"I really don't care for" as in I don't really like.
This works and will be fine for its purpose but if there are other popular methods I would love to compare/contrast.
-
"I really don't care for" as in I don't really like.
Sorry, I didn't now about this meaning in english.
This works and will be fine for its purpose but if there are other popular methods I would love to compare/contrast.
This is by far the best method for what you want to achieve. As I already said, it's simple and efficient.
The "venn diagram effect" is not an issue. If you have lights that overlap, you really want their contributions to be added. This may not be obvious here, but think about a red light and a green light: what would you expect the overlapping region to look like, if not yellow?