## Luven - Minimalist light engine

MissDanish
Citizen
Posts: 64
Joined: Wed Mar 07, 2018 11:21 pm
Location: Denmark

### Re: Luven - Minimalist light engine

ChicoGameDev wrote:
Sat Feb 23, 2019 3:44 pm
Yeah you are right I will work on optimization ! But if you have any suggestions I'll be happy to hear them
I haven't peaked into your code but an important thing to do when making a light system is to destroy all canvases when they're out of range. A canvas that is not drawn on screen will not only take up a large amount of VRAM but even GPU processing.
ChicoGameDev wrote:
Sat Feb 23, 2019 5:29 am
Yeahyay wrote:
Sat Feb 23, 2019 2:04 am
Would you be able to implement cone lights as well?
Hum, it would be useful only on 2d side-scroller no ? Could you please elaborate a little bit ?
This is what cone lights look like, this is an ancient screenshot from my game back when I used the Lights vs Shadows light system:
conelights.png (584.4 KiB) Viewed 5855 times
Cone lights can be made from a circular light, it probably wouldn't be hard to add it to your system.

I hope this helps a bit, would to see another good light system for LÖVE. I currently use Shädows which is not really ideal as it has a ton of features I don't need (like shadows).
Provides free hugs

ChicoGameDev
Prole
Posts: 35
Joined: Thu Feb 14, 2019 6:02 pm
Location: Switzerland
Contact:

### Re: Luven - Minimalist light engine

Hello everybody,
Nelvin wrote:
Mon Feb 25, 2019 6:50 am
Hm, not sure - I don't use camera alike systems alot or transform objects at all (my project is using Löve 0.10.2).

But in the end, what's required would be to transform any light on the screen to just the scaled down canvas so I guess what you'd have to do is to add the scaling to your camera transform and use the resulting transform to render all the lights to the canvas, then pop the transform (including the one used by the camera) and render the lightmap scaled to the full screen.
Thanks I will try again I probably just missed something
yetneverdone wrote:
Mon Feb 25, 2019 8:11 am
Hmmm since it has camera, what if don't render or process light when outside the camera boundaries?
Optimization that will probably comes in a future version
yetneverdone wrote:
Mon Feb 25, 2019 8:11 am
Also, does it really have to integrate camera to lighting system? What if users use other full-featured camera?

Here is my thinking about that :
During development I had problems between the shader and the camera, and it appears that the two of them where linked in many ways. Now that I'm experimenting without the shader, it looses a bit of interest to have an integrated camera system BUT actually... I like it a lot, I'm looking for making Luven a good "First lib to install when starting a new Löve2D project"... And actually I read a lot of cases where the Light system is not compatible with the camera system and peoples had to do a lot of tweaks to make them work together.. No problemo with Luven

However to tell Luven to let you manage the camera, just pass "false" as a third parameter to

Code: Select all

Luven.init(screenWidth, screenHeight, useCamera)
MissDanish wrote:
Mon Feb 25, 2019 9:38 am
I haven't peaked into your code but an important thing to do when making a light system is to destroy all canvases when they're out of range. A canvas that is not drawn on screen will not only take up a large amount of VRAM but even GPU processing.
Thanks for your participation (and your follow on twitter ). Actually Luven use no canvas and is slow because of my poor shader knowledge, but I'm currently working on a optimized version that will use canvases, so thanks a lot for insights.
MissDanish wrote:
Mon Feb 25, 2019 9:38 am
I hope this helps a bit, would to see another good light system for LÖVE. I currently use Shädows which is not really ideal as it has a ton of features I don't need (like shadows).
That's it ! No shadows, Luven only bring lights to your worlds ! That's the philosophy. Glad you like the idea !

Thanks everybody, stay tuned for new version.

Regards
Lionel Leeser

--

Always keep Game Dev as a passion.

yetneverdone
Party member
Posts: 334
Joined: Sat Sep 24, 2016 11:20 am
Contact:

### Re: Luven - Minimalist light engine

Hmmm I haven't tried any other lighting system so i will believe in your experience with them.

With that said, do you plan to add more features to the camera side? Stalker-x is a really good camera lib for reference

ChicoGameDev
Prole
Posts: 35
Joined: Thu Feb 14, 2019 6:02 pm
Location: Switzerland
Contact:

### Re: Luven - Minimalist light engine

yetneverdone wrote:
Mon Feb 25, 2019 11:16 am
With that said, do you plan to add more features to the camera side?
Of course I do ! I just couldn't think of more simple features for the first release. In my opinion the shake feature is the most useful !
yetneverdone wrote:
Mon Feb 25, 2019 11:16 am
Stalker-x is a really good camera lib for reference
Thanks for suggestion I will take a look.

Regards
Lionel Leeser

--

Always keep Game Dev as a passion.

ChicoGameDev
Prole
Posts: 35
Joined: Thu Feb 14, 2019 6:02 pm
Location: Switzerland
Contact:

### Luven v1.1 - Minimalist light engine

Hey everybody !!!

Your requests have been heard !

So here I come with Luven v1.1 !

Lets grab it on my github :
https://github.com/chicogamedev/Luven

What's news ? More FPS...

More possibilities, cone lights by default (hardly requested).

And if the lights by default don't suit your need :

Thanks all for your interest and please feel free to give me feedback and do not hesitate to post an issue on the repo :
https://github.com/chicogamedev/Luven/issues

I'm never very far from a keyboard we can chat about your needs !

I love working on Luven for this community. I'm very happy to have joined in !

Regards
Lionel Leeser

--

Always keep Game Dev as a passion.

lerabot
Prole
Posts: 2
Joined: Fri Apr 19, 2019 3:47 pm

### Re: Luven - Minimalist light engine

Hey, I've been using your lib and was wondering if we could use on own camera?

Yeahyay
Prole
Posts: 6
Joined: Sat Feb 23, 2019 1:58 am
Contact:

### Re: Luven - Minimalist light engine

lerabot wrote:
Fri May 03, 2019 12:25 am
Hey, I've been using your lib and was wondering if we could use on own camera?
I'm late as hell but just for anybody else reading, yes. Just convert camera coordinates into a love.math.newTransform object and send it to Luven.

ChicoGameDev
Prole
Posts: 35
Joined: Thu Feb 14, 2019 6:02 pm
Location: Switzerland
Contact:

### Re: Luven - Minimalist light engine

Hi, I'm actually late too... Sorry for inactivity.

Actually you just have to pass false as a third parameter to Luven.init. It will disable all the Luven camera system. You'll be able to use a custom or an already existing camera in your love.update and love.draw functions.

My answer can be a bit rusty because I'm not working since 2 month. Feel free to post your code and ask more questions.

Thanks for using Luven, I'm happy that it is usefull for you guys

Have a lövely day/evening/night.
Lionel Leeser

--

Always keep Game Dev as a passion.

Yeahyay
Prole
Posts: 6
Joined: Sat Feb 23, 2019 1:58 am
Contact:

### Re: Luven - Minimalist light engine

Yeahyay wrote:
Tue Jun 11, 2019 4:40 am
lerabot wrote:
Fri May 03, 2019 12:25 am
Hey, I've been using your lib and was wondering if we could use on own camera?
I'm late as hell but just for anybody else reading, yes.
Right:
Pass false on the third parameter to Luven.init().
Wrong:
To use luven's, just convert camera coordinates into a love.math.newTransform object and send it to Luven.
Oops.

### Who is online

Users browsing this forum: Google [Bot] and 5 guests