Dynamic lighting in LÖVE

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
2dee
Prole
Posts: 11
Joined: Sun Nov 23, 2014 6:53 pm
Contact:

Dynamic lighting in LÖVE

Post by 2dee »

Hey guys,

I just stumbled across this topic addressing shaders: viewtopic.php?f=5&t=78998.
I am currently running a Kickstarter for a tool that generates normal maps from 2D sprites in one click.

As the project Sprite DLight is already pretty successful, I'd like to learn how this could be integrated with various engines.

Image 

I would love to know the status of shader integration for LÖVE and I'd like to get in touch with the experts of this forum.
We are currently approaching the second stretch goal for Sprite DLight (a Mac version) and I am planning to establish a knowledge base, covering some of the most popular engines.

Dennis
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Dynamic lighting in LÖVE

Post by SiENcE »

Hi,

basically this already works with LÖVE (and more [dynamic shadowing,..]).

Try this.
https://www.love2d.org/forums/viewtopic.php?f=5&t=78998

No commercial tool needed ;).

cheers
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Dynamic lighting in LÖVE

Post by SiENcE »

Btw. i find this tool very unnessesary. You can easily create depth, specular and ambient maps with free tools like gimp.
User avatar
2dee
Prole
Posts: 11
Joined: Sun Nov 23, 2014 6:53 pm
Contact:

Re: Dynamic lighting in LÖVE

Post by 2dee »

Science, thanks for your input.
Actually, your link is the same as mine of the original post...

I'd love to know how you can create depth, specular and ambient maps with gimp. Are you talking about hand-painting them? :D

There is also a normal map plugin for GIMP, which can produce satisfying results for textures like stone surfaces, but when it comes to characters or objects, it isn't really useful. I made a small graph to compare the results:

Image

1. is the original sprite
2. is a Normal map created by the GIMP plugin (same as PS plugin)
3. is a Normal map created by a common normal map generator with the original sprite used as height map, followed by shape enhancement
4. is a Normal map created by Sprite DLight in one click

3. is the best result you can achieve with current automatic normal map generators combined with clever techniques, although the result is still pretty poor, it's more of a bevel effect, which is randomly concave or convex, particularly at the edges of the shape.

Anyway, the thread I mentioned doesn't clearly state if/how normal maps are handled in this shader.
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Dynamic lighting in LÖVE

Post by Jeeper »

2dee wrote:Science, thanks for your input.
Actually, your link is the same as mine of the original post...

I'd love to know how you can create depth, specular and ambient maps with gimp. Are you talking about hand-painting them? :D

There is also a normal map plugin for GIMP, which can produce satisfying results for textures like stone surfaces, but when it comes to characters or objects, it isn't really useful. I made a small graph to compare the results:

Image

1. is the original sprite
2. is a Normal map created by the GIMP plugin (same as PS plugin)
3. is a Normal map created by a common normal map generator with the original sprite used as height map, followed by shape enhancement
4. is a Normal map created by Sprite DLight in one click

3. is the best result you can achieve with current automatic normal map generators combined with clever techniques, although the result is still pretty poor, it's more of a bevel effect, which is randomly concave or convex, particularly at the edges of the shape.

Anyway, the thread I mentioned doesn't clearly state if/how normal maps are handled in this shader.
The Light vs Shadow does indeed "handle" normal maps. Check the wiki of the original version; viewtopic.php?f=5&t=77418
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

Re: Dynamic lighting in LÖVE

Post by drunken_thor »

I checked out your kickstarter and I will definitely be backing it! I have been using Crazy Bump up till now but your tool looks far superior!

EDIT: As the (second) author, of the light library I can tell you that the normal maps are shaded using, pixel shaders based on the normal and light positions. I am not really sure how much more information you want.

The Library can generate a height map from an image and then generate the normal map from the height map. These are not the greatest but nice for quickly trying things out.

I would love to see some other developments in this though because as the original author and I discussed in the thread you posted, there are certain reasons that the light_world library is not optimal.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Dynamic lighting in LÖVE

Post by SiENcE »

2dee wrote:Science, thanks for your input.
Actually, your link is the same as mine of the original post...

I'd love to know how you can create depth, specular and ambient maps with gimp. Are you talking about hand-painting them? :D
Oh I overlook your link.

Sort of. Normally I would create specular and ambient by drawing. Normal map can be generated, but of couse the results differ from tool to tool. The normal map your tool creates is indeed a lot better than the rest.
User avatar
2dee
Prole
Posts: 11
Joined: Sun Nov 23, 2014 6:53 pm
Contact:

Re: Dynamic lighting in LÖVE

Post by 2dee »

Great to have one of the authors of the light library here, thanks also for the positive feedback from all of you.
I apologize for not having done proper research before asking about the pixel shader, I will catch up on that (particularly regarding the reasons for the library not being optimal) as soon as everything calms down a bit.

@drunken_thor: what you describe sounds like pretty much the same thing I implemented in the tool's lighting preview, and this should be sufficient for the basic integration of Sprite DLight's normal maps.

Finally, a small update on my project: The second stretch goal has just been reached, so the tool will also be available in a Mac version.
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Dynamic lighting in LÖVE

Post by adnzzzzZ »

If you take a look at a tool called SpriteLamp (which already has been released I think), they already ship with GLSL shaders that do the work of applying normal, specularity, depth, AO maps to a sprite... All you have to do is take those shaders and translate them to LÖVE's GLSL, which really isn't a lot of work. Also thanks for linking this tool, since it's a lot more useful than SpriteLamp if it works as advertised.
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Dynamic lighting in LÖVE

Post by josefnpat »

This is a incredibly interesting tool! I have a few questions, before I consider pledging;

1) How much do you plan on selling the lite and the pro version after you're done?
2) How would you compare your product against SpriteLamp?

Thanks!
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 215 guests