Page 8 of 15

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

Posted: Sun Dec 21, 2014 6:16 pm
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.

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

Posted: Sun Dec 21, 2014 7:47 pm
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.

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

Posted: Sun Dec 21, 2014 7:48 pm
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 ;)

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

Posted: Sun Dec 21, 2014 8:44 pm
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! :)

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

Posted: Sun Dec 21, 2014 8:57 pm
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.

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

Posted: Sun Dec 21, 2014 9:02 pm
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.

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

Posted: Mon Dec 22, 2014 12:44 pm
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 4873 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 4873 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.

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

Posted: Mon Dec 22, 2014 2:37 pm
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.

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

Posted: Mon Dec 22, 2014 3:26 pm
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.

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

Posted: Mon Dec 22, 2014 7:17 pm
by giann
Yes, it's your fork that prompted me to start this project. Thanks man ! ;)