[CAPX] Yet another shadow caster

Show us your completed creations made in Construct 2

Post » Sun Oct 06, 2013 1:38 pm

So this method uses 4 canvas', but only 2 of them are drawn? This should mean it's using about the same resources as before, right? I'm wondering if I've tweaked your design a little too much for me to make this work. I may have to start again too.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

Post » Mon Oct 07, 2013 1:50 am

@xDGameStudios Had any luck? Have you tried out my version posted earlier?
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

Post » Mon Oct 07, 2013 4:53 pm

For my project I need flash light and (normal) lamp light, and I need the rest of the screen to be completly dark!

@AnD4D
I haven't tryed it yet... I looked at your samples the one you've made is very good and fast :) the other one is just toooooo slow.. 15fps :/
I'll try it today, maybe tomorrow :)xDGameStudios2013-10-07 16:54:25
B
11
S
3
G
5
Posts: 19
Reputation: 3,639

Post » Mon Oct 07, 2013 10:42 pm

@AnD4D

Have been trying to for 5 hours now.. with no luck.. think I'm missing something :/
B
11
S
3
G
5
Posts: 19
Reputation: 3,639

Post » Mon Oct 07, 2013 10:52 pm

@xDGameStudios

I wish we had this native. I also am looking for a flashlight and lamplight look. If I figure it out, I'll send you the capx. Can you do the same? :) Imagine if we're making the same game...

I manage to break the project more than I can make it work. I am starting to wonder if my brain is good enough for this... :(AnD4D2013-10-07 23:02:10
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

Post » Mon Oct 07, 2013 10:57 pm

Wow, destination in really kills the frame rate!!!
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

Post » Tue Oct 08, 2013 12:56 am

Hi,
I converted the example to use the Paster plugin instead of the Canvas plugin so it will be much faster with webgl.

This is the result of much tinkering and unfortunately even I have a hard time to see what I did. Basically the lighting is done with transparency and then the color is a separate canvas below so I can have finer control of the blending.
https://dl.dropboxusercontent.com/u/5426011/examples19/shadow_cast_paster.capx

Here is a simplified version that just has one light.
https://dl.dropboxusercontent.com/u/5426011/examples19/shadow_cast_paster_simple.capx R0J0hound2013-10-08 00:58:39
B
91
S
31
G
103
Posts: 5,238
Reputation: 67,762

Post » Tue Oct 08, 2013 1:51 am

Wow, thanks @R0J0hound,

I had to alter the resolution slightly for the advanced version, as 320x240 gave unusual results, but this looks like it's exactly what I've been looking for!

I can see what you meant earlier about concave objects. Interesting self shadow.

I can't seem to get my head around the use of the RES variable, however. This version may be a lot faster, but I still found it a useful operation to have available. I tried to add in /RES to the parameters as in the old version, but I managed to break it all, so quickly CTRL-Z'd :)

This is brilliant though! I'm quickly pulling it around to see what it can do, and how many strain it can take :)

Thank you so much!
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

Post » Tue Oct 08, 2013 1:58 am

RES isn't used, I forgot to remove it. If you want to use it just change set resolution int the start of layout to 640/RES,480/RES. It isn't used elsewhere.
B
91
S
31
G
103
Posts: 5,238
Reputation: 67,762

Post » Tue Oct 08, 2013 2:31 am

@R0J0hound

In my attempt to make it suitable to layouts of all sizes, I added in a feature that will destroy all of the pasters, and then re-create them (just to be tidy, and make sure they're in the same space). I then set their width and height to the size of the layout (so that they can be used everywhere), and finally, I set the resolution.

However, I noticed that when I scaled the paster objects, the resolution looked like it had dropped. I tweaked the resolution, as you suggested, and that didn't have any effect. Finally, I separated the family into their individual parts, and altered the scale for each, and I ended up with a black screen.

Please see the attached: https://dl.dropboxusercontent.com/u/50465867/Construct/NewLight.capx

I've made it work with any layout size (with a few more things to add to help maintain a high frame rate) but notice how low the resolution is? It doesn't matter how much I seem to change the RES variable, it doesn't appear to help.

It's a brilliant plugin, and thanks again. So close to getting it exactly how I want it. Any ideas how I can fix this resolution? The same technique worked fine for the older version.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

PreviousNext

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 2 guests