lights icon indicating copy to clipboard operation
lights copied to clipboard

Using for pixel art: low res lighting?

Open lukefisklennon opened this issue 6 years ago • 4 comments

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!

lukefisklennon avatar Nov 16 '18 00:11 lukefisklennon

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.

ivanpopelyshev avatar Nov 16 '18 07:11 ivanpopelyshev

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

wayfu avatar Nov 16 '18 20:11 wayfu

@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 avatar Nov 17 '18 00:11 lukefisklennon

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

lukefisklennon avatar Nov 17 '18 00:11 lukefisklennon