[Open Source Lib] My latest library, fastlighting

Show off your games, demos and other (playable) creations.
User avatar
XanthicDragon
Prole
Posts: 7
Joined: Fri Feb 13, 2015 7:30 pm

[Open Source Lib] My latest library, fastlighting

Post by XanthicDragon » Mon Sep 25, 2017 9:23 pm

Fastlighting is one of my first public libraries. I made it originally for personal use but decided that it'd be handy for anyone else. It uses the built in shader capabilities as well as a simple glsl shader to create pixel-perfect lighting. It maintains about 400FPS on my crappy laptop.

As the title suggests, this library is open source. Use it when you want, where you want. If you intend to republish it, at least give credit but otherwise I don't mind at all. You can get it here:
fastlighting.zip
Zip file of a runable folder.
(5.78 KiB) Downloaded 137 times
(Extract the ZIP archive and drag the fastlighting folder onto LOVE)

This has some nifty features in it:
  • Uses metatables just for the sake of ensuring that the modules are edited as intended.
  • Module-based coding. Each library has a new() function that can be used to create an object.
Unfortunately there are a couple of limitations and minor glitches at the moment, too. These should not be major issues:
  • A max of 128 lights can be registered (limitation of glsl and how I have my arrays set up)
  • Lighting is not affected by any geometry, so any walls and such will do nothing to lights. I'll get to this Soon™
  • Colored lights can pose issues if displayed on colored surfaces (i.e. blue light over red plane) but this should be fixed for the most part.
Last edited by XanthicDragon on Tue Sep 26, 2017 2:11 pm, edited 1 time in total.
"rawr ecksdee" --Xan the Dragon

Baby Inspector is best inspector. No exceptions.

User avatar
Sulunia
Party member
Posts: 198
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: [Open Source Lib] My latest library, fastlighting

Post by Sulunia » Tue Sep 26, 2017 12:23 am

It looks interesting, but also a bit vague. I ran your attached zip; is it supposed to be a static demo?

Also, do you have a project repository on github or something?
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia

sphyrth
Citizen
Posts: 56
Joined: Mon Jul 07, 2014 11:04 am
Contact:

Re: [Open Source Lib] My latest library, fastlighting

Post by sphyrth » Tue Sep 26, 2017 1:15 am

I also plan to release some of my work as Open Source, but I'm currently being overwhelmed by reading up on a lot of the different licenses. Looking at your code, there doesn't seem to be any license on it except for the "Readme.txt"

Don't get me wrong. Like I said, I'm confused about how to properly release something as Open Source. I thought that slapping the license in all of my files would do it.

User avatar
XanthicDragon
Prole
Posts: 7
Joined: Fri Feb 13, 2015 7:30 pm

Re: [Open Source Lib] My latest library, fastlighting

Post by XanthicDragon » Tue Sep 26, 2017 2:10 pm

Sulunia wrote:
Tue Sep 26, 2017 12:23 am
It looks interesting, but also a bit vague. I ran your attached zip; is it supposed to be a static demo?

Also, do you have a project repository on github or something?
I'll edit my OP to elaborate on this, but the folder inside is the runnable. Extract the fastlighting folder then drag the folder onto love. Otherwise no, I don't have a github for this but I was thinking on making one.
sphyrth wrote:
Tue Sep 26, 2017 1:15 am
I also plan to release some of my work as Open Source, but I'm currently being overwhelmed by reading up on a lot of the different licenses. Looking at your code, there doesn't seem to be any license on it except for the "Readme.txt"

Don't get me wrong. Like I said, I'm confused about how to properly release something as Open Source. I thought that slapping the license in all of my files would do it.

It's a bit weird. You have to mention that it's open source as I did in my original post. If it's copyrighted, you also have to explicitly mention that. I don't know what happens if you say nothing, but since I've mentioned that it's open source that's what it will be treated as.
"rawr ecksdee" --Xan the Dragon

Baby Inspector is best inspector. No exceptions.

User avatar
DanielPower
Citizen
Posts: 50
Joined: Wed Apr 29, 2015 5:28 pm

Re: [Open Source Lib] My latest library, fastlighting

Post by DanielPower » Tue Sep 26, 2017 6:45 pm

main.lua should not be called "Main.lua". This works on Windows because Windows does not have case sensitive file names, but causes it to fail on Linux and Mac.

Also, posting this as "Open Source" really just means "Here's the source code, you can look at it". You'll want to release the code under a specific license if you intend to give people the right to freely use it in their code.

Most Love libraries are released under the MIT license, for all intents and purposes, you can do whatever you want with the code as long as you don't claim that you wrote it.

Another popular license is the GPL, which says that you may do whatever you want with the code as long as you don't claim you wrote it, and also if you make changes to the code, you must also release them under the GPL or a compatible license.

Everything written in LOVE is automatically Open Source, because it is not compiled. Every .love file can be opened to view the source code. But that does not necessarily give you the legal right to reuse that code. That's what a license is for.

User avatar
bartbes
Sex machine
Posts: 4933
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: [Open Source Lib] My latest library, fastlighting

Post by bartbes » Tue Sep 26, 2017 10:18 pm

DanielPower wrote:
Tue Sep 26, 2017 6:45 pm
main.lua should not be called "Main.lua". This works on Windows because Windows does not have case sensitive file names, but causes it to fail on Linux and Mac.
And zip files are case-sensitive too.
DanielPower wrote:
Tue Sep 26, 2017 6:45 pm
Everything written in LOVE is automatically Open Source, because it is not compiled. Every .love file can be opened to view the source code. But that does not necessarily give you the legal right to reuse that code. That's what a license is for.
That really doesn't fit any common definition of "Open Source". It's a legal thing, not a technical thing. I can "view the pixels" of any photo, that doesn't mean I can redistribute it.
XanthicDragon wrote:
Tue Sep 26, 2017 2:10 pm
If it's copyrighted, you also have to explicitly mention that.
Actually, you don't. Copyright is automatically granted, copyright notices are mostly to identify the copyright owner. As far as I know the relevant "law" is the Berne Convention, signed by most of the world's countries.
XanthicDragon wrote:
Tue Sep 26, 2017 2:10 pm
You have to mention that it's open source as I did in my original post. [...] I don't know what happens if you say nothing, but since I've mentioned that it's open source that's what it will be treated as.
Open source does not have a specific legal meaning (as far as I know, I am not a lawyer). It's the specific license that grants users the right to use your work. In effect, you're saying "if you abide by these terms, I promise I won't sue you for infringement".

User avatar
Sulunia
Party member
Posts: 198
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: [Open Source Lib] My latest library, fastlighting

Post by Sulunia » Tue Sep 26, 2017 11:44 pm

XanthicDragon wrote:
Tue Sep 26, 2017 2:10 pm
Sulunia wrote:
Tue Sep 26, 2017 12:23 am
It looks interesting, but also a bit vague. I ran your attached zip; is it supposed to be a static demo?

Also, do you have a project repository on github or something?
I'll edit my OP to elaborate on this, but the folder inside is the runnable. Extract the fastlighting folder then drag the folder onto love. Otherwise no, I don't have a github for this but I was thinking on making one.
For purposes like this (showing off your work to folks around here), you'd want to make a .love game file instead. Look it up on the wiki!

As for running it, I did, I just didn't get what was I supposed to see, or if I can interact with the demo at all... Which is why I said the OP was a bit vague, since I couldn't really understand this even though I read it.

Finally, don't be shy to ask folks things around here. We may sound harsh, but we've all been on the same boat. :crazy:
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia

sphyrth
Citizen
Posts: 56
Joined: Mon Jul 07, 2014 11:04 am
Contact:

Re: [Open Source Lib] My latest library, fastlighting

Post by sphyrth » Wed Sep 27, 2017 12:15 am

I think one purposes of Open Source licenses is to protect you and your code.

If I was devious, for example, I would take your code, slap an MIT license in it, and make people think that I originally wrote it. Then I might go further and accuse you of not crediting me in your code.

I wished that releasing things as Open Source was just as simple as you did, but we are in a world with people who have unwanted intentions.

User avatar
XanthicDragon
Prole
Posts: 7
Joined: Fri Feb 13, 2015 7:30 pm

Re: [Open Source Lib] My latest library, fastlighting

Post by XanthicDragon » Thu Sep 28, 2017 2:45 pm

DanielPower wrote:
Tue Sep 26, 2017 6:45 pm
main.lua should not be called "Main.lua". This works on Windows because Windows does not have case sensitive file names, but causes it to fail on Linux and Mac.
That's .. interesting. I tested this on a mac through its whole lifetime. Worked absolutely fine with the filename "Main.lua". I don't know why that'd happen to you.
Sulunia wrote:
Tue Sep 26, 2017 11:44 pm
I didn't get what was I supposed to see, or if I can interact with the demo at all... Which is why I said the OP was a bit vague, since I couldn't really understand this even though I read it.
I suppose that is true. I guess I was a bit too dependent on people editing the code on their own. Suppose I could republish something that is more of a playable demo when I get the chance. The code as-is shows off the framerate in the top left while running a light in the center of the window to show that the light is rendered while maintaining a high framerate in the game, so I do understand how that could be taken as vague. Thanks.
"rawr ecksdee" --Xan the Dragon

Baby Inspector is best inspector. No exceptions.

User avatar
Nixola
Inner party member
Posts: 1928
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: [Open Source Lib] My latest library, fastlighting

Post by Nixola » Thu Sep 28, 2017 3:07 pm

Mac can be both case-sensitive and not, depending on a setting somewhere, if I recall correctly.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests