Closed rexrainbow closed 1 week ago
We can look at doing this with the new renderer (@BenjaminDRichards) but it's not possible with the current one. The texture filtering mode is set on the texture itself, not the frame, so if you apply it to an atlas, every frame of that atlas is rendered as 'nearest'. It's not a WebGL setting you can toggle on a per-draw basis, it's set on the texture itself.
Hi - I had a chat with Ben about this, and basically, it's not possible. The only way it could be done is to duplicate the WebGL texture it is using and set a different filter mode on the duplicate. Which of course doubles VRAM for that texture, but might be an option. You could 'emulate' this behavior today by loading the image twice, with different keys, and one of them uses NEAREST as the filter mode.
There has 2 kinds of solution to set pixel art rendering.
pixelArt
totrue
to assign pixel art to all rendering instancestexture.setFilter(1)
to assign pixel art to rendering instances which using this texture.Is it possible to assign pixel art by Image/Sprite's member method? i.e. render this Image/Sprite with Nearest filter?
Related issue : https://github.com/rexrainbow/phaser3-rex-notes/issues/448