Page 1 of 1

Hello, I am new and have a question about shadows

Posted: Wed Jan 25, 2017 5:51 pm
by Nikki
Hi first post here,

I hope I got the avatar correct ;)
Is there any dynamic dropshadow solution out there ?

Oh and btw, I've heard much good about this framework, its a nice experience so far playing around with it, thanks for that.

Re: Hello, I am new and have a question about shadows

Posted: Wed Jan 25, 2017 7:17 pm
by Tjakka5
You specifically said 'Drop shadow', so I do not know if this is what you're looking for, if not, please explain what you are looking for exactly.

To implement dynamic lighting you can use the "Light world" library:
https://github.com/tanema/light_world.lua

Note that this can be tricky to setup, and can cause quite a performance impact.

Re: Hello, I am new and have a question about shadows

Posted: Sat Jan 28, 2017 8:48 pm
by Nikki
yeah I mean some standard way of adding dynamic (and parameterized) drop shadows, as found in Flash and Photoshop, I don't think there is though, I've google quite extensively, I can however find some shader solutions that -given some work- might be able to do it.
Image

Re: Hello, I am new and have a question about shadows

Posted: Mon Jan 30, 2017 9:12 pm
by veethree
Material löve has a shadow module. You could look into that.

Re: Hello, I am new and have a question about shadows

Posted: Mon Jan 30, 2017 9:26 pm
by raidho36
Couldn't you just integrate the shadow into the sprite?

This kind of shadow is basically a solid black sprite with blur applied. Nothing fancy.

Re: Hello, I am new and have a question about shadows

Posted: Tue Jan 31, 2017 4:32 am
by Positive07
I'm the creator of Material-Love, I use circular images for circles, and 9 patch images for boxes.

Material-Love doesn't generate shadows at runtime, this means, that the level of the shadow is limited to the assets used which in the case of Material-Love means 5 levels of shadows.

It also means that is limited to boxes and circles so if you need a different shape Material-Love can't help you there.

I as raidho recommend that you use sprites like Material-Love does, or directly integrat the shadows in your assets. And only if you need to dinamically generate shadows for complex (non circles, nor boxes) shapes, use a shader.

A shader is far more expensive than an image, more so cause you need a shader that turns the asset into a black and transparent shape, and then you need to blur vertically and then horizontally, and after that you need to draw that displaced a certain amount. Those are multiple passes and can be costly (Maybe you could do a one pass shader but it will be costly, the best would be a two pass shader)

Consider well your options!