Löve "Light vs. Shadow" Engine v2

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
joedono
Prole
Posts: 40
Joined: Mon Mar 04, 2013 6:58 pm

Re: Löve "Light vs. Shadow" Engine v2

Post by joedono »

drunken_thor wrote:Please try the most recent version of the code, I just released a bunch of optimizations and one of them was to take out the complicated directional light math and use an arc stencil instead. That should clear up your issues.
Yep. Latest version has it fixed up just fine.
User avatar
soulaymenc
Prole
Posts: 36
Joined: Thu Jul 11, 2013 2:03 pm
Contact:

Re: Löve "Light vs. Shadow" Engine v2

Post by soulaymenc »

Uhh, sorry I got no where else to ask, how can I rotate the normal map ?
This world is so strange.
User avatar
qaisjp
Party member
Posts: 490
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: Löve "Light vs. Shadow" Engine v2

Post by qaisjp »

This is bloody brilliant! Image
Lua is not an acronym.
User avatar
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

Post by drunken_thor »

soulaymenc wrote:Uhh, sorry I got no where else to ask, how can I rotate the normal map ?
There is no way to do that currently I can add in rotation to image and normal modifiers. while I am at it I might as well add scaling as well.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
giann
Prole
Posts: 42
Joined: Fri Jun 28, 2013 11:38 am

Re: Löve "Light vs. Shadow" Engine v2

Post by giann »

Is it possible to have shadows cast over bodies that do not cast shadows ?
I would like to use the normal map effect on the floor tiles but when I add bodies that do not cast shadows, the character's shadow does not cast over them:

Without floor bodies:
withoutnormalfloor.png
withoutnormalfloor.png (100.73 KiB) Viewed 7610 times
With floor bodies and normal maps:
withnormalfloor.png
withnormalfloor.png (97.93 KiB) Viewed 7610 times
User avatar
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

Post by drunken_thor »

giann wrote: Is it possible to have shadows cast over bodies that do not cast shadows ?
I would like to use the normal map effect on the floor tiles but when I add bodies that do not cast shadows, the character's shadow does not cast over them:
Yeah I will have to rewrite a bit though, I use normal maps to stencil out shadows that are calculated from the shapes edges. It is a trick to save some optimizations but your use case seems pretty useful so I will have to rethink it. I will get back to you soon I havent been feeling too well lately so I havent been working on the project that much.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
giann
Prole
Posts: 42
Joined: Fri Jun 28, 2013 11:38 am

Re: Löve "Light vs. Shadow" Engine v2

Post by giann »

Alright. Maybe you could include that behaviour with a setting to turn it on or off. And preserve the optimization for those who do not need normals to behave like that ;)
giann
Prole
Posts: 42
Joined: Fri Jun 28, 2013 11:38 am

Re: Löve "Light vs. Shadow" Engine v2

Post by giann »

I think I did it !
yes.png
yes.png (111.33 KiB) Viewed 7565 times
I pass to the shadow shader an image with only the non-floor normals. I apply the shadow attenuation over normals only if not on a non-floor normal. I can do a pull request if you want ;)
User avatar
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

Post by drunken_thor »

giann wrote: I pass to the shadow shader an image with only the non-floor normals. I apply the shadow attenuation over normals only if not on a non-floor normal. I can do a pull request if you want ;)
Yeah you submit a pull request but please test the issue that you were having with wall block shadows overlapping other wall blocks. That was one of the reasons the shader was set up as a stencil like that.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
User avatar
nucular
Prole
Posts: 22
Joined: Sun Mar 16, 2014 1:23 pm

Re: Löve "Light vs. Shadow" Engine v2

Post by nucular »

Is it possible to apply the light/shine map to the drawn objects, so that tiles hidden behind other tiles (casting a shadow on them) are actually hidden (but objects the light shines on aren't)? I am using the engine together with STI if that is relevant.

To clarify, I marked the areas that I don't want to be lit in this image:
Image

I'd guess it would be possible if the light/shine map could be drawn on the shadow map additively.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests