How do I make better shadows

0 favourites
  • 12 posts
  • Hi all, little question: I'm using the ShadowLight object together with the ShadowCaster behavior, and the results are fine, but the shadows stays underneath objects.

    I would like to make shadows cover objects, is that possible? And how would I?

  • Anyone knows if this is possible? I've been having no success.

  • That's interesting. I tried and no success too, hope it's possible.

    I'll stick around to see if someone knows :p

  • People have asked this way before and till today it seems that no one knows

    Some old threads asking the same thing:

    The shadow mystery remains

  • Putting the shadowlight object on it's own higher layer did the trick last i checked.

  • R0J0hound, this makes the objects get all black, as if their own shadow is covering then. As the guy said in one of the links above.

    Can you do this and still see the sprites normally? If yes, can you explain or show how? Because I tried everything I could think of. Only way I see is to give every shadowcaster a black frame and use it if player do not have LOS to him, but that's not right at all haha.

  • Then maybe putting the light object in a layer below?

  • Then maybe putting the light object in a layer below?

    Light must stays on top of other objects or they will be seen anywhere don't matter if the light illuminates then or not. :/

  • Ashley, any chance of achieving this?

    Make shadows cover other objects, and still see the objects normally when not covered by shadows?

    Like the guy say here:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah I understand now I think. You could do a three layer setup. Objects on the bottom layer and light in the middle. Then if any object has a line of sight to the light you can move it to the top layer.

    Another idea is to just do shadows yourself, either with the “paster” or “custom draw” plugins. Basically it’s just a quad from each edge with two points projected with a ray from the light to the edge corners. The trick to show objects in the light and hide those in shadow would be to only use edges facing away from the light. Anyways there was an old example of this done with the canvas or paster plugin I think.

    Edit:

    Example using "custom draw"

    https://www.dropbox.com/s/frqgdyhvo90qk ... .capx?dl=1

    plugin:

    plugin-custom-draw_t190098

  • Ah I understand now I think. You could do a three layer setup. Objects on the bottom layer and light in the middle. Then if any object has a line of sight to the light you can move it to the top layer.

    It 'kind of works'. 'Works' because the sprite appear and disappear according to the LOS to light. 'Kind of' because it doesn't look normal, since I will see all the sprite even if the light is illuminating just a little part of it, or the sprite will get black even if I am seeing a part of it.

    Another idea is to just do shadows yourself, either with the “paster” or “custom draw” plugins. Basically it’s just a quad from each edge with two points projected with a ray from the light to the edge corners. The trick to show objects in the light and hide those in shadow would be to only use edges facing away from the light. Anyways there was an old example of this done with the canvas or paster plugin I think.

    Will have a look, would then work normally on mobile?

  • I’d assume so but I have no idea.

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