ShadowCasting la Whiteclaws

Show us your completed creations made in Construct 2

Post » Tue Aug 27, 2013 1:41 am

Hi ,

After seeing keepee's example , I wanted to make my own implementation of the shadowcasting , so after 2 hours of procrastination , Here it is !

Mine doesn't have artifacts and is not CPU intensive ...

Edit : It even has a steady 60 FPS , supports multiple lightsources and complex polygons :)

The only flaw it has is you need to set up the mask by yourself , but that shouldn't be that hard ...Whiteclaws2013-08-27 02:20:18
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Tue Aug 27, 2013 2:08 am

Awesome job Whiteclaws!
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
119
S
41
G
17
Posts: 2,211
Reputation: 19,634

Post » Tue Aug 27, 2013 3:52 am

Drooling so hard.

I must have this.
B
3
G
3
Posts: 18
Reputation: 911

Post » Tue Aug 27, 2013 5:25 am

This looks great - do you have an example capx?
B
36
S
8
G
3
Posts: 328
Reputation: 7,757

Post » Tue Aug 27, 2013 5:28 am

Actually, no worries, I found the example from R0j0Hound:
http://www.scirra.com/forum/dynamic-shadows-now-possible_topic56174.html
B
36
S
8
G
3
Posts: 328
Reputation: 7,757

Post » Tue Aug 27, 2013 5:39 am

Is this using canvas? I wouldn't have thought so.

How simple was this to pull off? I'm getting over 30fps on my tablet, which is great. Shame not touch friendly.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
80
S
12
G
7
Posts: 965
Reputation: 10,750

Post » Tue Aug 27, 2013 6:02 am

@EyeHawk I highly doubt his .cap is using the same strategy as r0j0Hound's example. In r0j0Hound's example, he is spawning dummy objects as reference points for drawing on the canvas in real time. This leads to many disadvantages. For one, you can only facilitate 4 sided objects. Secondly, spawning 4 dummy objects per object you want casting shadows quickly eats power and decreases frame rate. Another annoyance is that unless you reset the position of the dummies EVERY TICK, no shadow-casting objects can be moved, as the shadows cast from their original positions.

Here's hoping that Whiteclaws' method involves a less clunky strategy for drawing the shadows: one that supports higher shadow casting object counts and doesn't eat frame rate as bad.

@Whiteclaws Are you able to move the shadow-casting objects in real time as well?
B
3
G
3
Posts: 18
Reputation: 911

Post » Tue Aug 27, 2013 12:37 pm

This looks great, but I'd like to see these features:

* Shadows that aren't completely black
* Coloured lights
* 'Textured' lights (like in Mark of the Ninja)
* Light Cones

Get those working, and this'll be perfect. I wouldn't mind also being able to detect whether an object is 'lit' or covered by a shadow, for stuff like stealth games.Candescence2013-08-27 12:41:11
B
94
S
37
G
11
Posts: 404
Reputation: 11,275

Post » Tue Aug 27, 2013 1:51 pm

@Silhouette

It's possible , I'll add this next update

@Candescence

I'll try to add those too

Bear in mind that it's not mindblowing , it's just a small trick I pulled off waiting for when @Ashley gives us access to the collision box points of an object

Also , no dummy objects , but takes some setup on edittimeWhiteclaws2013-08-27 13:53:18
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Tue Aug 27, 2013 6:28 pm

Too bad , Rogo bet me again , all I can do now is release my capx to the public ^^

Dynamic lighting
{Right Click} Drag N' Drop/Create new lightsources
{Left Click } Delete lightsources
Whiteclaws2013-08-27 18:28:58
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Next

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 3 guests