Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

pixi-lights in isometric scenes, sprite Masks

$
0
0

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

  1. checking for sprites in the radius of the light and
  2. 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.


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>