Page 7 of 12

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

Posted: Wed Apr 23, 2014 2:50 pm
by giann
Can you provide your .love ?

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

Posted: Wed Apr 23, 2014 3:32 pm
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.

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

Posted: Thu Apr 24, 2014 9:00 am
by giann
I think you would have to create a newImage for each frame and add/remove them which might be slow.

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

Posted: Fri May 02, 2014 3:44 pm
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?

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

Posted: Fri May 02, 2014 9:44 pm
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.

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

Posted: Fri May 02, 2014 10:17 pm
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.

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

Posted: Wed May 07, 2014 4:26 am
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.

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

Posted: Thu May 15, 2014 2:42 pm
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 ?

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

Posted: Fri May 16, 2014 8:44 am
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 :)

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

Posted: Sat May 31, 2014 5:56 am
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.