Page 9 of 15

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

Posted: Tue Dec 23, 2014 12:08 am
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.

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

Posted: Wed Dec 24, 2014 10:35 pm
by soulaymenc
Uhh, sorry I got no where else to ask, how can I rotate the normal map ?

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

Posted: Fri Dec 26, 2014 3:57 pm
by qaisjp
This is bloody brilliant! Image

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

Posted: Sun Dec 28, 2014 2:19 am
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.

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

Posted: Tue Dec 30, 2014 3:42 pm
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 7304 times
With floor bodies and normal maps:
withnormalfloor.png
withnormalfloor.png (97.93 KiB) Viewed 7304 times

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

Posted: Tue Dec 30, 2014 9:36 pm
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.

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

Posted: Wed Dec 31, 2014 6:34 am
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 ;)

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

Posted: Wed Dec 31, 2014 3:25 pm
by giann
I think I did it !
yes.png
yes.png (111.33 KiB) Viewed 7259 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 ;)

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

Posted: Wed Dec 31, 2014 6:05 pm
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.

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

Posted: Sat Jan 03, 2015 8:04 pm
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.