Lighting by loading individual pixels

This forum is currently in read-only mode.
  • 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.

  • 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:

    scirra.com/forum/effect-color-fusion-masked_topic41460.html

  • 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

    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!

  • 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.

    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..

  • towersdevelopment.files.wordpress.com/2011/07/fire.png

    This is the effect I'm trying to get in a nutshell.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

    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.

  • 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.

    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 :)

  • And start small, then experiment and learn by doing :)

    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.

  • 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

    mediafire.com

    Here's my cap under the assumption that I'm not doing any of it right.

  • Please have a look at the examples provided with the effect. Download those caps and investigate them.

    The concept of Color Fusion (Masked) is just the other way round than you tried. Also, it clearly said, that it is a layer effect, you won't have much success using it as an object effect.

    Start by reading the description in the Color Fusion (Masked) thread, then download both example caps and look how it is done.

  • If you don't need a sprite to be partially lit (like just lighting only the overlapping light part) then you can make the image of your character in the dark as a separate sprite and always put it on top of the normal sprite, then change the opacity of the dark sprite according with the light intensity. The ligh intensity can be easily calculated using the distance of the sprite to the light source.

  • Well thank you both for your advice, I have gotten the effect to work now, as I didn't fully read what was written about the effect before. I feel kinda dumb for not doing so. :P

    I'm sure I can figure out the rest now.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)