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

Using for pixel art: low res lighting? #35

Open lukefisklennon opened 5 years ago

lukefisklennon commented 5 years ago

Hi there!

I'm using pixi-lights for a retro game with pixel art. The original low res image is loaded with PIXI.SCALE_MODES.NEAREST and then scaled up. It looks pretty good. However, the lighting cast onto the sprite is soft and high res. I want to maintain that low res pixel art effect. For example:

image

That's 4 pixels from the original sprite, but scaled up (5x) and with the lighting effect, it's lost that low res effect to a degree. I'm not sure if I'm explaining this very well.

So how would I go about fixing this?

Thanks so much!

ivanpopelyshev commented 5 years ago

Lighting uses getRenderTexture() thingy from pixi-display plugin. You can introduce a lower resolution there, and make PR, I'll accept it.

Pretty much any change in lights leads to edits in internals of plugins because this thing is experimental.

wayfu commented 5 years ago

Might be worth trying a mosaic filter at your desired big-pixel size perhaps?

lukefisklennon commented 5 years ago

@ivanpopelyshev Thanks for the quick reply and pointing me in the right direction. Because I'm new to Pixi, I currently don't really know how to add this feature, but if/when I ever do I'll send a PR right away.

lukefisklennon commented 5 years ago

@wayfu Ok thanks, I'll try this out soon.