Löve "Light vs. Shadow" Engine [0.4.3]

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
giann
Prole
Posts: 42
Joined: Fri Jun 28, 2013 11:38 am

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Post by giann »

Can you provide your .love ?
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Post by Jeeper »

I actually just realized that lightImage.setShadowType() is not lightWorld.newImage(). It works now, thank you :)

Btw, do you know if it is possible to have an animated character also have an "animated shadow". IE change the shadow every frame to match the frame that the character is having.
giann
Prole
Posts: 42
Joined: Fri Jun 28, 2013 11:38 am

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Post by giann »

I think you would have to create a newImage for each frame and add/remove them which might be slow.
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Post by Jeeper »

Got a small issue with image shadows. When you have a light source on exactly the left or right side of an object, the image shadow becomes 1px wide.

Image

I have been trying to implement a threshold so that the shadow never becomes that narrow, but have yet to succeed. Anyone else had this and fixed it?
User avatar
PriorBlue
Prole
Posts: 43
Joined: Fri Feb 28, 2014 3:46 am
Location: Munich, Germany

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Post by PriorBlue »

Jeeper wrote:Got a small issue with image shadows. When you have a light source on exactly the left or right side of an object, the image shadow becomes 1px wide.

Image

I have been trying to implement a threshold so that the shadow never becomes that narrow, but have yet to succeed. Anyone else had this and fixed it?
Yes i know, the theoretical problem is, that the image has no deep, so you can't cast a shadow from the side. In your special case (sphere), it could be possible to fake the side shadow by rotating, but this won't work for custom sprites.

But you can try the circle shadow type, maybe this is ok for your art style.
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Post by Jeeper »

PriorBlue wrote:
Jeeper wrote:Got a small issue with image shadows. When you have a light source on exactly the left or right side of an object, the image shadow becomes 1px wide.

Image

I have been trying to implement a threshold so that the shadow never becomes that narrow, but have yet to succeed. Anyone else had this and fixed it?
Yes i know, the theoretical problem is, that the image has no deep, so you can't cast a shadow from the side. In your special case (sphere), it could be possible to fake the side shadow by rotating, but this won't work for custom sprites.

But you can try the circle shadow type, maybe this is ok for your art style.
Ah.. yeah. Well like you said, I could use circles for that. Or just accept that it does that, because it is till really cool.

Btw I have a small other problem, I sent you a PM with a .love.
User avatar
CrackedP0t
Citizen
Posts: 69
Joined: Wed May 07, 2014 4:01 am
Contact:

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Post by CrackedP0t »

On my computer, the third shader (the one after grainy grayscale) throws this error:

Code: Select all

Error: lib/postshader.lua:124: Variable 'screen' does not exist.
A common error is to define but not use the variable.
stack traceback:
	[C]: in function 'send'
	lib/postshader.lua:124: in function 'addEffect'
	examples/complex.lua:430: in function 'draw'
	[string "boot.lua"]:438: in function <[string "boot.lua"]:399>
	[C]: in function 'xpcall'
This was using an Intel Core i7 for the GPU.
/人 ◕‿‿◕ 人\
Here, have an umlaut. Ö
giann
Prole
Posts: 42
Joined: Fri Jun 28, 2013 11:38 am

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Post by giann »

Everything seems to be messed up when using love.graphics.translate or love.graphics.scale.
I narrowed it down to the multiple shaders you're using. When I comment them out everything is ok.

What can I do to fix that ?
giann
Prole
Posts: 42
Joined: Fri Jun 28, 2013 11:38 am

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Post by giann »

I managed to find out why everything was messed up with love.graphics.scale: multiple canvas are used to apply the different shaders, so the scale factor is applied each time. I just had to apply the scale only when actually drawing to the screen.

I'll do a pull request :)
Muris
Party member
Posts: 131
Joined: Fri May 23, 2014 9:18 am

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Post by Muris »

Hello!

This project seems quite nice, but I was wondering if you can actually use it easily for determining if an object is visible for light source? I was trying to look at the source and I felt, I could be wrong, that this project uses some kind of trick to draw the lights, instead of "clipping" the shadows from circle.

Anyway regardless of how the program is done, would there be any easy way around to keep a list of objects that are visible for certain light source, when it is building the light map?

Thank you for taking your time to read above post.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests