Page 4 of 5

Re: Shädows (A light engine)

Posted: Sat Nov 17, 2018 10:30 am
by DeNick
MissDanish wrote: Sat Nov 17, 2018 3:45 am
zorg wrote: Fri Nov 16, 2018 6:08 pm
DeNick wrote: Fri Nov 16, 2018 3:19 pm It's not quite what I need. Updated the link to the video.
https://www.youtube.com/watch?v=HcuPDtpkEUU
You are limiting what gets actually rendered, right? and you're not rendering things outside of the visible viewport, right? Because that can eat tons of extra processing that could be avoided.
If you are referring to the actual lights that shouldn't be an issue since I actually helped make sure nothing unnecessary is rendered when the lights are not in range. It even destroys the canvases when it's out of range (the part I helped with).
The fact is that when I add a motion to an object in love.update, FPS immediately drops to 200-250 (before that it was about 700-800). When adding a new lighting FPS even more begins to fall. The movement of the object I do as follows:

Code: Select all

	local x,y = newBody2:GetPosition()
	newBody2:SetPosition(nx,750)

	if (x >= 700 and move) then 
		 nx = nx + 0.5
		move = true
		if (nx >= 900) then 
			move = false
		end
	end

	if (x <= 900 and not (move)) then 
		nx = nx - 0.5
		move = false
		if (nx <= 700) then 
			move = true
		end
	end

Re: Shädows (A light engine)

Posted: Sat Nov 17, 2018 2:48 pm
by Starkkz
It's very likely that the problem you're facing is the softness shader being applied to every particular light. You can disable that effect by setting the Light.Blur to false.

Re: Shädows (A light engine)

Posted: Sat Nov 17, 2018 3:39 pm
by DeNick
Starkkz wrote: Sat Nov 17, 2018 2:48 pm It's very likely that the problem you're facing is the softness shader being applied to every particular light. You can disable that effect by setting the Light.Blur to false.
OMG. I could not find the problem for so long. Thank you very much!

Re: Shädows (A light engine)

Posted: Sat Nov 17, 2018 6:44 pm
by Starkkz
I'm sorry about this missing information, I'm going to add it to the wiki.

Re: Shädows (A light engine)

Posted: Tue Nov 27, 2018 10:14 am
by MissDanish
Would you be willing to add square lights to Shädows?

Re: Shädows (A light engine)

Posted: Sat Dec 15, 2018 1:42 am
by Starkkz
MissDanish wrote: Tue Nov 27, 2018 10:14 am Would you be willing to add square lights to Shädows?
Sorry for the late answer. I'm a bit curious to know how can you possibly cast a shadow from a light source that has the shape of a square, I understand that this is totally possible but I haven't tried this before, I will try to find some articles about this.

Re: Shädows (A light engine)

Posted: Sat Dec 15, 2018 4:41 am
by MissDanish
Starkkz wrote: Sat Dec 15, 2018 1:42 am
MissDanish wrote: Tue Nov 27, 2018 10:14 am Would you be willing to add square lights to Shädows?
Sorry for the late answer. I'm a bit curious to know how can you possibly cast a shadow from a light source that has the shape of a square, I understand that this is totally possible but I haven't tried this before, I will try to find some articles about this.
No it's okay, I am just glad to get any kind of response. It would actually theoretically improve the performance of my game since I have to do some not so great tricks to achieve square shapes for windows and neon signs. What I do currently is to make a rectangle out of multiple round lights which is not good for performance as intersecting lights from my understanding harm performance quite a lot. It would also give off a much more more convincing effect with windows and monitors I think.

EDIT: also while you're at it you should also consider adding cone lights like the Light vs Shadow library, should be an easy addition if you do it like that library did it.

Re: Shädows (A light engine)

Posted: Sun Dec 16, 2018 5:22 pm
by Starkkz
Out of curiosity, does a rectangular light source even cast a shadow on a body? Since it's from a top-view perspective, the center of the rectangular light source is all around the shape, then the intensity of the light is equal in all of the shape's area, the projected shadow would appear under the body, but since it's a top-view perspective, the casted shadow wouldn't be visible at all.

The only variable I see here is the distance of the rectangular light source from the ground. That would lower the intensity of the rectangular light source.

Is this what you need?

Re: Shädows (A light engine)

Posted: Mon Dec 17, 2018 11:54 pm
by MissDanish
Starkkz wrote: Sun Dec 16, 2018 5:22 pm Out of curiosity, does a rectangular light source even cast a shadow on a body? Since it's from a top-view perspective, the center of the rectangular light source is all around the shape, then the intensity of the light is equal in all of the shape's area, the projected shadow would appear under the body, but since it's a top-view perspective, the casted shadow wouldn't be visible at all.

The only variable I see here is the distance of the rectangular light source from the ground. That would lower the intensity of the rectangular light source.

Is this what you need?
I personally don't use the shadows, just the lights.

I'd like something roughly like this (tried to simulate it as best as possible in paint.NET), which is what you described I think
Untitled.png
Untitled.png (6.25 KiB) Viewed 8195 times

Re: Shädows (A light engine)

Posted: Sun Dec 23, 2018 8:12 am
by Sir_Silver
Hi there! I've started to use this library in my project. I'm using love.physics and the latest version of love too.

I'm having a with shadows not rotating with the physics body that they are associated with after creating a body, shadow, and then calling body:TrackPhysics(myPhysicsBody).

I've only tested it on polygon, height, and normal shadows, and they all seem to have the problem of not rotating with the physics body (in this case a rectangle).

In addition to not rotating to match the physicsBody's angle, when a normal shadow or height shadow is attached to a body and that body is trying to TrackPhysics of a physics body, the shadow becomes anchored to the center of the physics body, which has the affect of the shadow not properly "squaring up" with they actual physics body. I've been trying to resolve these problems myself in the library but it's a little difficult and it would be best if they were solved properly by the author I think.