Pixel perfect textures with an orthgraphic camera?

Hi!

I need to get pixel-perfect textures on planes using an orthographic camera.

I can get this working fine if my source image is a power of 2 (eg: 1024x512). I then apply this texture to a plane, and only show part of the plane.

This isn’t great though - for interface work I need to use images that aren’t a power of 2, and I really only want the plane to be the same size as the texture…

I’ve attached a zipped Unity project folder. If you hit play it cycles between a plane that works, using a texture of 1024x512 (grid_POT), and a plane that doesn’t, using a texture of 700x474 (grid_NPOT).

Any ideas how I can get grid_NPOT to show pixel-perfect?

Thanks :slight_smile:

255040–9187–$pixel_perfect_1_117.zip (1.09 MB)

Hmmm just a random idea I got - maybe one can write a shader that somewhat enforces pixel-perfection, helping with situations where you’re off-by-one or off-by-0.5 or so.

Not sure if it would work, and not sure if that’s really your problem.