Lighting by loading individual pixels

For questions about using Classic.

Post » Tue Aug 02, 2011 12:25 am

I'd have a cap to show my progress if I had any idea where to start. My game revolves mostly around light. There are several light sources about. Anything not in light is turned into a different image based on the object. For instance, the background turns black and enemies/solids turn to dark silhouettes. That I can probably do. But my problem is that this requires a second image. Not much of a problem, unless an object is standing inbetween a light source and darkness. I'd need it to load the individual pixels from the different images in order to make it look right.

Absolutley no idea where to start on that. Though I do know that each object will need something added to it's code to get it to work right.

Help please.

Note: I am no n00b to game making in general, I have done excessive modding.
B
2
G
1
Posts: 14
Reputation: 528

Post » Tue Aug 02, 2011 12:53 am

HiYouNamedMatt :D

depending on what exactly it has to do, Color Fusion (Masked) could be of help. It is an effect, have a look at the description and download link here:

http://www.scirra.com/forum/effect-color-fusion-masked_topic41460.html

EDIT: Strange, the link gives me an error although correct. Try copying this:
http://www.scirra.com/forum/effect-color-fusion-masked_topic41460.htmltulamide2011-08-02 00:55:44
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Aug 02, 2011 1:16 am

[QUOTE=tulamide] HiYouNamedMatt :D

depending on what exactly it has to do, Color Fusion (Masked) could be of help. It is an effect, have a look at the description and download link here:

http://www.scirra.com/forum/effect-color-fusion-masked_topic41460.html

EDIT: Strange, the link gives me an error although correct. Try copying this:
http://www.scirra.com/forum/effect-color-fusion-masked_topic41460.html[/QUOTE]

Thanks! Hm... I'm still learning about alot of the features in Construct, so I'll have to mess around with this to see how it works, and then more to get the exact effect I want. Thanks for the effect!
B
2
G
1
Posts: 14
Reputation: 528

Post » Tue Aug 02, 2011 1:24 am

[QUOTE=HyMyNameIsMatt] For instance, the background turns black and enemies/solids turn to dark silhouettes. That I can probably do. But my problem is that this requires a second image. Not much of a problem, unless an object is standing inbetween a light source and darkness. I'd need it to load the individual pixels from the different images in order to make it look right.

Absolutley no idea where to start on that. Though I do know that each object will need something added to it's code to get it to work right.[/QUOTE]

You can achieve that effect by simply setting the enemies/solids color filters to 0,0,0, or black..or dark grey, if your background is also black..
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Aug 02, 2011 1:56 am

http://towersdevelopment.files.wordpress.com/2011/07/fire.png

This is the effect I'm trying to get in a nutshell.
B
2
G
1
Posts: 14
Reputation: 528

Post » Tue Aug 02, 2011 2:06 am

If you just have one light source, have a look at the ghostshooter tutorial, that explains how to do such an effect without using too much gpu load.

If you will have several light sources with different behaviours, movements, rotations, animations, colors and the like, then Color Fusion (Masked) fits perfect.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Aug 02, 2011 2:11 am

[QUOTE=tulamide] If you just have one light source, have a look at the ghostshooter tutorial, that explains how to do such an effect without using too much gpu load.

If you will have several light sources with different behaviours, movements, rotations, animations, colors and the like, then Color Fusion (Masked) fits perfect.[/QUOTE]

Alright, but just so we're clear on the effect I want to get, "I like to be sure". Objects outside of light will not just be darker, but a whole different color. Silhouette. The reason this is so important, is because a creture in the dark could have a darker body, but white eyes that show clearly. I probably should have mentioned that earlier. :P

Either way thanks for being so helpful.HyMyNameIsMatt2011-08-02 02:11:53
B
2
G
1
Posts: 14
Reputation: 528

Post » Tue Aug 02, 2011 2:25 am

[QUOTE=HyMyNameIsMatt] Alright, but just so we're clear on the effect I want to get, "I like to be sure". Objects outside of light will not just be darker, but a whole different color. Silhouette. The reason this is so important, is because a creture in the dark could have a darker body, but white eyes that show clearly. I probably should have mentioned that earlier. :P

Either way thanks for being so helpful.[/QUOTE]
That is exactly what Color Fusion (Masked) was made for. You select whatever color/darkness you like for the parts that are not lit. The lighting is realized with objects on a layer that are used to cut holes in the non-lit color, giving the impression of lighting that area. For the wolves example you would create a seperate object with just the shape of his eyes and place them on the mask layer and move them together with the wolf. His eyes would show as you created them (or even mix-colored with the eyes on the mask layer), but the rest of the body tinted with the non-lit color.

There might be other methods to achieve this, Color Fusion (Masked) just makes it easier to achieve. So wait for others to show other ways, maybe there is one that serves your purposes better.

And start small, then experiment and learn by doing :)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Aug 02, 2011 2:30 am

[QUOTE=tulamide]And start small, then experiment and learn by doing :)[/QUOTE]

Truer words have never been spoken. Alright, I'll figure out how to do all that with it. Thanks for the help!

I just remembered that the entities are built with bone movement and several body part sprites, so I guess this means I'll have to do it to quite a few objects. I'll get started now.HyMyNameIsMatt2011-08-02 02:35:09
B
2
G
1
Posts: 14
Reputation: 528

Post » Tue Aug 02, 2011 10:35 pm

I think I understand a bit more now, but I don't know how to make the affect only be applied to individual pixels. :P

http://www.mediafire.com/?al7tp44okwlz2c4

Here's my cap under the assumption that I'm not doing any of it right.
B
2
G
1
Posts: 14
Reputation: 528

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests