Hello lövers!
I'm very happy and very proud to announce my first ever open source contribution to the world : Luven !
I actually fell in love with LÖVE and Lua some month ago and started to understand lots of things that I've never understood before... So here we are : Luven v1.0 is out.
Everything you need to know is on the repo : https://github.com/chicogamedev/Luven
If you have any question, feedback, complain or else : this thread is a good place to discuss.
If you want to be kept updated on the project :
https://trello.com/b/4kLFwfyV
or
https://twitter.com/ChicoGameDev
I really hope you'll find Luven an utility, I'm sure you will. I already integrated it in my game.
Have a lövely day/night !
Regards
Luven - Minimalist light engine
- ChicoGameDev
- Citizen
- Posts: 71
- Joined: Thu Feb 14, 2019 6:02 pm
- Location: Switzerland
- Contact:
Re: Luven - Minimalist light engine
The library works really well and is as minimal as it says; and I love it.
Would you be able to implement cone lights as well?
Would you be able to implement cone lights as well?
- yetneverdone
- Party member
- Posts: 448
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: Luven - Minimalist light engine
Too bad I get low fps on my old system
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
- ChicoGameDev
- Citizen
- Posts: 71
- Joined: Thu Feb 14, 2019 6:02 pm
- Location: Switzerland
- Contact:
Re: Luven - Minimalist light engine
Hello,
--
But how bad it is actually ? Like just adding the lib completely kills your FPS ? Or have you already a small amount of FPS and the lib just kill just enough to get you bad perfs ?
Thanks for your feedback guys !
Regards
Thank you for feedback ! Glad you like it !
Hum, it would be useful only on 2d side-scroller no ? Could you please elaborate a little bit ?
--
Sorry mate, I'm developing on a last-gen MacBook Pro so....
But how bad it is actually ? Like just adding the lib completely kills your FPS ? Or have you already a small amount of FPS and the lib just kill just enough to get you bad perfs ?
Thanks for your feedback guys !
Regards
- yetneverdone
- Party member
- Posts: 448
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: Luven - Minimalist light engine
With your example, at startup I get 4fps. When I change the size of the image to a 512x512x png, I get around 50fps.
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Re: Luven - Minimalist light engine
The way this is implemented requires super beefy hardware, even without any active light sources. Reducing the maximum number of light sources (two NUM_LIGHTS constants in luven.lua) should improve fps considerably for you.
- ChicoGameDev
- Citizen
- Posts: 71
- Joined: Thu Feb 14, 2019 6:02 pm
- Location: Switzerland
- Contact:
Re: Luven - Minimalist light engine
Hello,
Regards
Yeah you are right I will work on optimization ! But if you have any suggestions I'll be happy to hear them
Regards
Re: Luven - Minimalist light engine
A simple change that would make it scale a lot better would be to have the enabled lights all at the start of the array and limit the loop in the shader to process only these lights. That way you would also get rid of that nasty if(light.enabled) in the shader that hurts performance.ChicoGameDev wrote: ↑Sat Feb 23, 2019 3:44 pm But if you have any suggestions I'll be happy to hear them
There's only so much that can be done without reworking the entire simplistic design. I would render the lights as geometry into a lightmap to get decent performance with more than a handful light sources. That would also allow culling, custom light shapes and also the use of shaders for other purposes.
- ChicoGameDev
- Citizen
- Posts: 71
- Joined: Thu Feb 14, 2019 6:02 pm
- Location: Switzerland
- Contact:
Re: Luven - Minimalist light engine
Hi,
But that made me win only 40 fps average and when too many lights are active, if the laptop you use have no graphic card the FPS still goes down dramatically, I think I will put 32 lights by default for the moment.
I actually trying to think about ways to allow culling and avoid useless calculations, but I'm afraid I'm far from having enough experience at the moment.
Thanks for your answer.
Regards
Yes I've already done that ! I've read that ifs like this are really bad for shaders. Thanks for pointing it out.grump wrote: ↑Sat Feb 23, 2019 8:48 pm A simple change that would make it scale a lot better would be to have the enabled lights all at the start of the array and limit the loop in the shader to process only these lights. That way you would also get rid of that nasty if(light.enabled) in the shader that hurts performance.
But that made me win only 40 fps average and when too many lights are active, if the laptop you use have no graphic card the FPS still goes down dramatically, I think I will put 32 lights by default for the moment.
I'm really intrigued by what you're saying. And I would love to learn more about. Please if you can/want to share with me your knowledge this could be wonderful !grump wrote: ↑Sat Feb 23, 2019 8:48 pm There's only so much that can be done without reworking the entire simplistic design. I would render the lights as geometry into a lightmap to get decent performance with more than a handful light sources. That would also allow culling, custom light shapes and also the use of shaders for other purposes.
I actually trying to think about ways to allow culling and avoid useless calculations, but I'm afraid I'm far from having enough experience at the moment.
Thanks for your answer.
Regards
Re: Luven - Minimalist light engine
I use a VM that has no GPU acceleration as a "slow machine" simulator for performance testing, and your demo went from 8 fps before the change to 90 fps after the change. Still pretty slow, but I would consider 11x faster a sizable improvement.ChicoGameDev wrote: ↑Sat Feb 23, 2019 11:28 pm But that made me win only 40 fps average and when too many lights are active, if the laptop you use have no graphic card the FPS still goes down dramatically, I think I will put 32 lights by default for the moment.
For a simple lighting model like this, you can render the lights onto a Canvas, then draw that canvas on top of the game graphics using multiplicative blending. Doesn't even require a shader. The lights can be of any shape and form, like textured quads. Quick example attached.I'm really intrigued by what you're saying. And I would love to learn more about. Please if you can/want to share with me your knowledge this could be wonderful !
- Attachments
-
- lights.love
- (1.07 MiB) Downloaded 648 times
Who is online
Users browsing this forum: No registered users and 4 guests