resize light?

For questions about using Classic.

Post » Sat Jun 04, 2011 12:56 am

[quote="Jayjay":f741zsh6][quote="Mr Wolf":f741zsh6]Light object can do things Sprite can't. If I remember correctly, Sprite doesn't work with Shadow Caster.[/quote:f741zsh6]

I thought the light object was the source, and a sprite must have the shadow caster behavior to create shadows :?[/quote:f741zsh6]
This thread about the same thing was created recently: viewtopic.php?f=2&t=9612
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Sat Jun 04, 2011 3:06 am

[quote="Mr Wolf":2d4d1mn4][quote="Jayjay":2d4d1mn4][quote="Mr Wolf":2d4d1mn4]Light object can do things Sprite can't. If I remember correctly, Sprite doesn't work with Shadow Caster.[/quote:2d4d1mn4]

I thought the light object was the source, and a sprite must have the shadow caster behavior to create shadows :?[/quote:2d4d1mn4]
This thread about the same thing was created recently: viewtopic.php?f=2&t=9612[/quote:2d4d1mn4]

Yeah, I had suggested the same solution to that problem as well.

Here is a cap I made to show how to use a sprite to graphically represent a light object: [url:2d4d1mn4]http://dl.dropbox.com/u/4714446/LightWithASprite.cap[/url:2d4d1mn4]

As shown, the resizing of the light requires recalculation of shadow depth each tick. To support multiple/dynamic lights, you can use a circular sprite that further surrounds the each light to check for collisions. If an object is in that circle, then it recieves its shadow from that light (this does create a limit of one light acting on an object at a given time, but should be able to be counteracted by using fake "baked" shadowmaps and lighting for static map objects).
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests