Okay I worked with karai17 and he pushed a fix to STI so that it now works with this library. I also added an STI example to the examples!Jeeper 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.
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
Re: Löve "Light vs. Shadow" Engine v2
Whoa, I just checked out the STI demo and I am really impressed with how it turned out! I'm glad I fixed that right away instead of sitting on it for a few weeks, ha!
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Löve "Light vs. Shadow" Engine v2
@drunken_thor, Thanks for including the examples for camera plugins! However the translation inverted all of my camera movement(because I get the x and y of the drawn player which I use for camera movement), thankfully there is a simple fix for that:
Update: I found a bug(?) in the way that shadow rectangles are drawn, this bug can be replicated in the simple example. Its not related to the translations done above. Heres a gif:
Code: Select all
tx,ty = love.graphics.getWidth()/(2*camera.scale), love.graphics.getHeight()/(2*camera.scale)
tx = tx-camera.x
ty = ty-camera.y
LightMouse:setPosition(love.mouse.getX() - tx, love.mouse.getY() - ty)
lightWorld:setTranslation(tx,ty)
camera:lookAt(player.x,player.y)
- 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
@relazy is that at the edge of the screen? I know there is some problems with the range checking for screen range I just havent had the time to fix it yet.
- 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
@relazy, Okay the new code should be all fixed up, the reason I left it off was because I was initializing some shadow bodies by the center x, y and some by the topleft x, y and had to fix those first before range could be fixed
Re: Löve "Light vs. Shadow" Engine v2
Do you think there's room for improvements in terms of performances ?
My FPS drops really quickly the more I add bodies and lights.
Edit: Another weird issue is that FPS seems to drops relative to the screen size regardless of the number of lights/bodies.
800x450: 50fps
1280x720: 20fps
with the same number of lights/bodies
My FPS drops really quickly the more I add bodies and lights.
Edit: Another weird issue is that FPS seems to drops relative to the screen size regardless of the number of lights/bodies.
800x450: 50fps
1280x720: 20fps
with the same number of lights/bodies
Re: Löve "Light vs. Shadow" Engine v2
Awesome! Its all fixed now, thank you.drunken_thor wrote:@relazy, Okay the new code should be all fixed up, the reason I left it off was because I was initializing some shadow bodies by the center x, y and some by the topleft x, y and had to fix those first before range could be fixed
Also:
Its not really weird that the FPS drops when increasing resolution as the number of pixels increase. The shadow bodies/light are drawn 'on screen' and not 'off screen', so any of the shadow bodies located outside of the screen area ('on screen')are not accounted for. A clear example of this is the bug I described above whereby the rectangle was considered 'off screen' when it was actually 'on screen'.giann wrote:Do you think there's room for improvements in terms of performances ?
My FPS drops really quickly the more I add bodies and lights.
Edit: Another weird issue is that FPS seems to drops relative to the screen size regardless of the number of lights/bodies.
800x450: 50fps
1280x720: 20fps
with the same number of lights/bodies
When you increase the canvas(screen) size, you increase the amount of pixels to draw and therefore performance drops as the resolution of the shadows increases which means that there are more calculations to do.
There is more to this but I don't think I have a concrete understanding of it. If any of my points are incorrect please feel free to correct them.
Last edited by Relazy on Thu Dec 11, 2014 7:18 pm, edited 1 time in total.
Re: Löve "Light vs. Shadow" Engine v2
I'm aware that off screen lights/bodies are not accounted for. The numbers I gave take that fact into account.
The drop should not be that drastic in my opinion. If I can't have 3 lights and 5 bodies at 720p at 30fps minimum, this is a performance issue, not a normal occurence.
The drop should not be that drastic in my opinion. If I can't have 3 lights and 5 bodies at 720p at 30fps minimum, this is a performance issue, not a normal occurence.
Re: Löve "Light vs. Shadow" Engine v2
True, although I doubt that it's optimized enough, what machine are your running on?giann wrote:I'm aware that off screen lights/bodies are not accounted for. The numbers I gave take that fact into account.
The drop should not be that drastic in my opinion. If I can't have 3 lights and 5 bodies at 720p at 30fps minimum, this is a performance issue, not a normal occurence.
I get a stable 70 fps with AMD radeon HD 6450 and a quad core 3.4 ghz processor on a resolution of 800 x 600.
Re: Löve "Light vs. Shadow" Engine v2
AMD radeon HD 6350. 800x600 is fine, > 1024 is far worse.
Who is online
Users browsing this forum: No registered users and 4 guests