Löve "Light vs. Shadow" Engine v2

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

Re: Löve "Light vs. Shadow" Engine v2

Post by drunken_thor »

Important! just published an update that will now require update to be called on your light world. This optimizes range checking of light bodies.

Please see the git page for the examples.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Löve "Light vs. Shadow" Engine v2

Post by Jeeper »

Have you made any benchmarks compared to the "old" light vs shadow engine, will probably swap over to this one when there is a noticeable difference in performance.
giann
Prole
Posts: 42
Joined: Fri Jun 28, 2013 11:38 am

Re: Löve "Light vs. Shadow" Engine v2

Post by giann »

Shadow blur was set by default. Do I have to set it manually now ?
I set bloom like this:

Code: Select all

lightWorld.post_shader:addEffect('bloom', {2.0})
Also :setDirection on light is messed up (or it doesn't represent the same thing as before).

I'll do some benchmarking and get back to you for the optimization part ;)
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Löve "Light vs. Shadow" Engine v2

Post by Jeeper »

giann wrote:Shadow blur was set by default. Do I have to set it manually now ?
I set bloom like this:

Code: Select all

lightWorld.post_shader:addEffect('bloom', {2.0})
Also :setDirection on light is messed up (or it doesn't represent the same thing as before).

I'll do some benchmarking and get back to you for the optimization part ;)
Thanks! :)
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

Re: Löve "Light vs. Shadow" Engine v2

Post by drunken_thor »

giann wrote:Shadow blur was set by default. Do I have to set it manually now ?
I set bloom like this:

Code: Select all

lightWorld.post_shader:addEffect('bloom', {2.0})
Also :setDirection on light is messed up (or it doesn't represent the same thing as before).

I'll do some benchmarking and get back to you for the optimization part ;)
Ah yes the shadow blur default changed, I just changed it back to 2.0. I tested bloom again with how you are setting it and it all works still so I am not sure what is happening there.

What kind of behaviour are you experiencing on setDirection? I will check on it and see what I can find.

As for benchmarks,
simple example: old = 60fps, new = 80fps
you can see it better yourself by playing with the new code.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

Re: Löve "Light vs. Shadow" Engine v2

Post by drunken_thor »

giann wrote:Shadow blur was set by default. Do I have to set it manually now ?
I set bloom like this:

Code: Select all

lightWorld.post_shader:addEffect('bloom', {2.0})
Also :setDirection on light is messed up (or it doesn't represent the same thing as before).

I'll do some benchmarking and get back to you for the optimization part ;)
Okay I just pushed a fix for set direction, there was a calculation error on how it is set.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
giann
Prole
Posts: 42
Joined: Fri Jun 28, 2013 11:38 am

Re: Löve "Light vs. Shadow" Engine v2

Post by giann »

Light directions are still messed up :(

I also get an issue when two rectangle bodies are next to each other. Light should not be able to pass between them but I still get this:

Before:
before.png
before.png (78.78 KiB) Viewed 4850 times
Now: (don't mind the completely black rectangles, they are out of the player's sight and thus, not drawn)
after.png
after.png (66.57 KiB) Viewed 4850 times
Note: I know it would be better to create a single body for each complete wall, but still, it should not behave like that. Also the perf boost when using a single rectangle for the whole wall instead of a body for each cell isn't really noticeable.

As for fps matters: I didn't notice a significant improvement. Which does not mean there isn't any: I have two computer for testing, one with a very bad gc and another with a great one. So I either get crap fps or a steady 60.
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

Re: Löve "Light vs. Shadow" Engine v2

Post by drunken_thor »

Okay sorry about that, I took out some functionality because I didnt think it added that much but I didnt think about how you are using it. I just push a commit adding that back in, you shoud not see the shadow overlap any more.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

Re: Löve "Light vs. Shadow" Engine v2

Post by drunken_thor »

Also, that is a good looking game! It has come a long way since the first screenshots. Glad I could help out with that.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
giann
Prole
Posts: 42
Joined: Fri Jun 28, 2013 11:38 am

Re: Löve "Light vs. Shadow" Engine v2

Post by giann »

Yes, it's your fork that prompted me to start this project. Thanks man ! ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests