Advanced "flashlight" - layered blending and transparency

0 favourites
  • 5 posts
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • In the Example Browser in the C3 editor (see the Start tab), there is an example called, "Simple Lighting" that shows how to create a kind of "top-down flashlight" (or a light shining against a wall ahead of you...depends on your perspective, I guess). This is simple enough and I have used it many times before in past projects.

    What I want to do is a bit more complicated (or so I think...I honestly still struggle to understand how the blending properties work).

    I want to make it so that objects highlighted by the flashlight beam (overlap object) are visible to the player during gameplay.

    The basic level environment I don't need to be part of the blending equation. I just need to know how to do what amounts to "layered blending".

    Here is the current .C3P file as it is so far...https://drive.google.com/file/d/1DMVDP5RRhxB79eYiFfMftpbi42bbLEH7/view?usp=drive_link

    Thank you!

  • dop2000 or R0J0hound - May I request either of your help, please?

  • FURTHER INFO: The layer that the Flashlight object is on has "force own texture" checked and the Flashlight object, itself, is using the Destination Out blend option.

    This is the part that works fine.

    In order to make it so that the hidden objects on the floor stay hidden while the walls are visible, I'm trying to set it up so that the layer with "force own texture" is 75% opaque while trying to find the setting(s) that make it so the obstacle is invisible until it is overlapped with the Flashlight. It is that last part that I'm having trouble with.

    What layer do I put the obstacle on?

    What blend mode do I set it to? Or do I need to set another layer to a blend mode? Both?

    What other layers do I need to set to "force own texture"?

    I sort of understand "source" and "destination". My current understanding is that "source" is the object on top and usually the object with the blend mode active. "Destination" is the object below the "source" and sometimes on another layer.

  • I don't understand the question. The main useful blend modes are normal, additive and destination-out (which erases). You'd have to experiment with the other ones.

    To only show stuff in the light you'd have a layer

    with force own texture = yes

    with transparent = no

    with color = black

    and the light object on that layer with destination-out (which is the same as erase).

    Any layers under that will be hidden if not over that light, and any layers above will always be visible.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound I believe I understand. Experimentation, indeed, is called for. But since this is for a game jam, I'm going to have to save that for another time. It's not a critical feature, thankfully. Thank you!

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