Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Corwar on September 25, 2013, 11:04:35 PM

Title: Atlas with Filter Mode - Point
Post by: Corwar on September 25, 2013, 11:04:35 PM
I would like to use Point filter Mode so I can achieve the pixel perfect look for my 2d gui. For some reason when I simply just switch from trilinear mode to point mode, nothing else, on the created atlas image, the image seems to get corrupted a bit (almost like a shifted look ). Anybody else experience this? Pics below

Edit: mabie not the image itself, but somehow the graphics on screen gets this unwanted effect. The atlas image itself seems to look fine in the preview

Unity 4.2.1f4
NGUI 3.0.0e

Title: Re: Atlas with Filter Mode - Point
Post by: ArenMook on September 26, 2013, 04:09:42 PM
Do you understand what point filtering does? It means "choose the closest pixel". Bilinear/trilinear interpolation actually interpolates between pixels, which is what gives a smoother result.

You're getting exactly what you're asking for.
Title: Re: Atlas with Filter Mode - Point
Post by: Corwar on September 26, 2013, 09:43:50 PM
AH my bad. Thankyou. I remember doing this back in my DirectX7/8/C++ days by taking two screen points for something like a 256x256 texture with one point being the x,y and the other being the endpoint of the width and height. Then, transform those points to world coords for the quad mesh for the texture. This allowed me to align the texils to the screen pixels so the image wouldn't look fuzzy/blurry. I can't remember exactly, but I think I had to add .5 to the uv's to get it right. So that's what I need to figure out here is to align the texils with pixels so I wont get the crooked pixel look as with the picture I shown above(ie: as with what you explained, so it won't choose the incorrect pixel ). I want this for a clean GUI look for an editor, not for the fuzzy 3D gamey look. Anyways, thanks again and I hope I didn't bother you.
Title: Re: Atlas with Filter Mode - Point
Post by: ArenMook on September 27, 2013, 06:20:37 PM
You don't need point filtering for that. NGUI already offsets by a half pixel if you followed its hierarchy (UIAnchor does it). As long as your UI is pixel-perfect, it will be crisp. Select your UIRoot, set it to pixel perfect, then hit ALT+SHIFT+P to force everything to be pixel perfect.