@drunken_thor : speaking of optimizations and speed, while nosing around in the code, I think I noticed that the library currently draws all shadows, for all bodies, for each light. From what I can see, it doesn't take into account whether there is something between a body and a light, or whether the body is too far away from the light for it's shadow to be drawn. Is this correct? Are you looking at optimizing this?
I can't offer coding help right now (I was thinking of optimizing it myself, but I'm working on other areas of my project atm), but I can try testing your solutions.
Also, the animation support sounds really good
Löve "Light vs. Shadow" Engine v2
Re: Löve "Light vs. Shadow" Engine v2
Awesome work ! Thanks a lot !
There seems to be a problem with multiple lights.
I have 2 lights: the first is ok, the second works ok for the shadows but the bodies are not lighted.
There seems to be a problem with multiple lights.
I have 2 lights: the first is ok, the second works ok for the shadows but the bodies are not lighted.
- 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
I optimized this now so I make sure that the object is both on screen and within light range. Optimizing it future (i.e. seeing if it is already in shadow) would probably not optimize it much further because the checking would be costly.nfey wrote: @drunken_thor : speaking of optimizations and speed, while nosing around in the code, I think I noticed that the library currently draws all shadows, for all bodies, for each light. From what I can see, it doesn't take into account whether there is something between a body and a light, or whether the body is too far away from the light for it's shadow to be drawn. Is this correct? Are you looking at optimizing this?
I can't offer coding help right now (I was thinking of optimizing it myself, but I'm working on other areas of my project atm), but I can try testing your solutions.
Also, the animation support sounds really good
Animations are now supported, check them out in the new release demo I just posted.
Please try the new code that I just released. And report back to me because I redid how shine and shadow are calculated. Sorry about making you rewrite.giann wrote: Awesome work ! Thanks a lot !
There seems to be a problem with multiple lights.
I have 2 lights: the first is ok, the second works ok for the shadows but the bodies are not lighted.
- 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
Just a update on this, I have been playing around on getting these two libraries working together and have figured out what is the problem, please follow this bug that I have logged with the creator of STI https://github.com/karai17/Simple-Tiled ... /issues/65Jeeper wrote:Just a PSA to anyone who intends to use this library and is using STI, the v2 of Shadow vs light changed the way it uses canvases and does not like STI for that reason. After struggling for a long time with trying to implement this updated version to my current project, I spoke to "drunken_thor" (Who manages the library) and he confirmed that it is not compatible with STI.
The old Shadow vs Light does not have this issue however, so If you intend to use STI then I would recommend using it. A few major improvements made in this version are missing though, but I have managed to fix most of them (Such as scaling and translation, removal of shadow and light bodies etc). So if you intend to do like me and use the older version, feel free to ask for help in case you run into any issues.
Re: Löve "Light vs. Shadow" Engine v2
The issue with multiples ligths is fixed. But now the shadow aren't blurred. I tried :setShadowBlur with no success.
- 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 I see you are right, the whole shadow drawing process was rewritten, I was bound to miss something. I will let you know when I get that back working.giann wrote:The issue with multiples ligths is fixed. But now the shadow aren't blurred. I tried :setShadowBlur with no success.
Cool looking game you got there! Have you noticed any better performance?
- 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 push a change that will fix it though when the number gets higher it leaves objects with weird halos I doubt your will see it with normal values but I will try and mitigate it anyways.giann wrote:The issue with multiples ligths is fixed. But now the shadow aren't blurred. I tried :setShadowBlur with no success.
Re: Löve "Light vs. Shadow" Engine v2
Not really since there is nothing much. I'll get a better idea when i'll add more lights. With the old version of light vs shadow, fps was dropping quickly when there was more than 3-5 lights.
I switched back body:drawImageShadow to your previous version, I prefer the shorter shadows. Or is there an option I can use ?
I switched back body:drawImageShadow to your previous version, I prefer the shorter shadows. Or is there an option I can use ?
Re: Löve "Light vs. Shadow" Engine v2
Blur is back ! Thks
- 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
If you increase the z position on your light you will find that the shadows become more finite however image shadows are a lot better for things like characters.
Who is online
Users browsing this forum: No registered users and 1 guest