pixijs / lights

Adds dynamic lighting via deferred shading to PixiJS
https://pixijs.io/lights/docs/index.html
MIT License
198 stars 29 forks source link

fixes ambient light directionality #29

Closed sjlynch closed 5 years ago

sjlynch commented 5 years ago

Removes direction from the ambient light fragment shader.

ivanpopelyshev commented 5 years ago

I agree that ambient shouldn't have direction.

sjlynch commented 5 years ago

Woo! My first pull request was accepted! Thanks!

I'm going to try to modify this locally to enable multiple sprite layers. Currently if you have multiple containers e.g. ground layer, background layer, sprite layer, foreground layer, etc., the top-most layer is where the lighting is applied. So this causes a lot of issues with my engine -- i'll see if i can create an elegant fix for this. Of course I could just be doing something wrong.

ivanpopelyshev commented 5 years ago

I'm working on a way to make it easier, to use one Sprite for multiple layers instead of container of sprites, each for one layer.

Also, there's "sorting layer" abstraction that i want to make easier: https://pixijs.io/examples/#/layers/normals-drag.js