boxy icon indicating copy to clipboard operation
boxy copied to clipboard

Having the ability to set the internal textures filtering

Open SkyVault opened this issue 3 years ago • 2 comments

My usecase for this is for games using pixel art, I have been scaling up my images so that the bi-linear filtering isn't as apparent, but I would like to be able to set the texture filtering to minNearest / magNearest.

SkyVault avatar Feb 15 '23 15:02 SkyVault

I also want this, but actually most pixel games don't just set minNearest / magNearest as it looks terrible.

See here and how wavy it looks: https://www.shadertoy.com/view/ltBGWc

One needs to do manual filtering, and there are some tradeoffs.

https://csantosbh.wordpress.com/2014/01/25/manual-texture-filtering-for-pixelated-games-in-webgl/

I have tried to implement something like this but have not solved it yet.

You want to use mipmapping when pixels are small enough, when you zoom in and rotate you want the pixel to look more like little rectangles with AA ages:

image

That will make pixel art look great.

Scaling up pixel art might be more performant then custom filtering... I would have to test that out.

treeform avatar Feb 16 '23 02:02 treeform

Yeah you are correct, this is a very hard problem I've been wanting to find a solution for, I also have a 3d project that uses a pixel art style and the attempts I've made to make that look good have all been pretty bad, but yeah I'm going to see what I can come up with for this project, I also got a lot of interesting reading to do, thanks for the response!

SkyVault avatar Feb 23 '23 17:02 SkyVault