Hello, I am new and have a question about shadows

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Nikki
Citizen
Posts: 87
Joined: Wed Jan 25, 2017 5:42 pm

Hello, I am new and have a question about shadows

Post 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.
User avatar
Tjakka5
Party member
Posts: 243
Joined: Thu Dec 26, 2013 12:17 pm

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

Post 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.
User avatar
Nikki
Citizen
Posts: 87
Joined: Wed Jan 25, 2017 5:42 pm

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

Post 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
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

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

Post by veethree »

Material löve has a shadow module. You could look into that.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post 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.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

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

Post 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!
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests