Wintermute Posted October 8, 2021 Share Posted October 8, 2021 Hi, I'm currently making a small isometic demo using pixi-layers and pixi-lights. I got stuck trying to prevent a PointLight from affecting a Sprite if the lights y-coordinate is lower than the Sprites y-coordinate(aka Sprite is "in front" of the light). Linked is a small example of what I'm trying to create. Notice how the pillar goes dark when the character (light source) is behind it. https://www.youtube.com/watch?v=Q5P23eI0SqU&ab_channel=TimMiller My initial attempt was to try and recreate the effect by checking for sprites in the radius of the light and adding a prerendered inverted mask to the point Light for each sprite in radius that also has higher y-coordinate. This worked well when testing with Graphics, but I can't get Sprite masks to work on point lights (the entire light disappears after setting the mask). I guess my questions are if it is possible to make Sprite mask work with point light. Or is there a better way to do this altogether? PS Code is much to large to post here, but please ask if any snippets would help you understand what I'm trying to do. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 9, 2021 Share Posted October 9, 2021 you have to draw "black" sprites of those column inside lighting layer. that's one of things that needed for real lighting plugin. This one is experimental for many years, so, its up to you to do something Also do you really need normal lights? Quote Link to comment Share on other sites More sharing options...
Wintermute Posted October 9, 2021 Author Share Posted October 9, 2021 I'm not sure if I need normals, I kind of want to compare results with and without them to find out?. I'll definitely try the black sprite approach this weekend, it sound like it might actually be less work than going with masks. BTW do you maybe know why Sprite masks don't work on lights but stencil masks do? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.