I'm drawing a grid, pretty much like one can see in the Unity editor itself or any 3D-editor, many 3D-related applications and some games. But it doesn't look pretty in my case.
I put a few random objects to make perspective more readable.
Please also see it full-size for clearer view on the artifacts at a distance.
How grid is rendered
- Whole grid is one big plane.
- There is texture representing one cell.
- The cell is multiplicated by tiling.
How there are different line thicknesses on the picture?
It's just 3 planes (each with one grid) with different settings on top of each other. I could leave only one, but 3 grids demonstrate my problem better.
- Mipmap is disabled (grid cells disappear very soon over distance when it's enabled).
- Trilinear filtration and maximum aniso are set (looks worse otherwise).
I think over distance lines get to be thinner than a pixel, especially under shallow angle (hence “verticals” lines look better than “horizontal”.
Grid rendering is obviously done many times before me, so I presume it should be pretty much wide knowledge how to draw them prettily. I tried to google it, but any query formulation I tried led only to completely unrelated stuff. I have a bit of ideas what I can try, but I believe it would be reinventing the wheel.
P.S.: I'm using Unity engine, but I believe the engine is irrelevant.
Plane simple blurring suggested by user29244 and Thebluefish really makes huge difference: Biggest lines are too blurry now, but it's irrelevant, because easy to fix. Note that I had to enable mipmaping if you're trying to reproduce it.