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.
Löve "Light vs. Shadow" Engine v2
- 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
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
Shadow blur was set by default. Do I have to set it manually now ?
I set bloom like this:
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
I set bloom like this:
Code: Select all
lightWorld.post_shader:addEffect('bloom', {2.0})
I'll do some benchmarking and get back to you for the optimization part
Re: Löve "Light vs. Shadow" Engine v2
Thanks!giann wrote:Shadow blur was set by default. Do I have to set it manually now ?
I set bloom like this:Also :setDirection on light is messed up (or it doesn't represent the same thing as before).Code: Select all
lightWorld.post_shader:addEffect('bloom', {2.0})
I'll do some benchmarking and get back to you for the optimization part
- 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
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.giann wrote:Shadow blur was set by default. Do I have to set it manually now ?
I set bloom like this:Also :setDirection on light is messed up (or it doesn't represent the same thing as before).Code: Select all
lightWorld.post_shader:addEffect('bloom', {2.0})
I'll do some benchmarking and get back to you for the optimization part
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.
- 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
Okay I just pushed a fix for set direction, there was a calculation error on how it is set.giann wrote:Shadow blur was set by default. Do I have to set it manually now ?
I set bloom like this:Also :setDirection on light is messed up (or it doesn't represent the same thing as before).Code: Select all
lightWorld.post_shader:addEffect('bloom', {2.0})
I'll do some benchmarking and get back to you for the optimization part
Re: Löve "Light vs. Shadow" Engine v2
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: Now: (don't mind the completely black rectangles, they are out of the player's sight and thus, not drawn) 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.
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: Now: (don't mind the completely black rectangles, they are out of the player's sight and thus, not drawn) 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.
- 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
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.
- 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
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
Yes, it's your fork that prompted me to start this project. Thanks man !
Who is online
Users browsing this forum: No registered users and 2 guests