- Home /
Flashing mesh grid lines problem
Hi,
I'm building tiled plane mesh in code and all is working correct. I need to display grid lines on my ground so I've painted 2 pixel border on each tile in my tiles texture.
Problem is that lines further from camera doesn't look as good as close to camera and also when I move camera back and forth grid lines flashing all over the place.
You can see from this picture that some lines are gray etc.
I've increased Aniso to 9 from 1, this helped a little, but lines still flashing. I also have mipmaps off.
Is there anything I can do to solve the problem? Maybe drawing grid different way somehow?
At the moment my tiles are in 512x512 texture, no padding and each tile is 32x32 pixels.
Any help is appreciated.
Answer by senad · Feb 14, 2012 at 09:10 AM
This is actually what Mip Maps are made for, so you should turn them on and be happy.
Also I can not find a good link describing the topic, but you could read it up in the OpenGL Red Book, if you are interested.
:)
Answer by ernis_mac · Feb 14, 2012 at 11:11 PM
In my case Mip Maps makes it look much worse as further from camera it gets all blurry. Switching them off makes a big difference.
What I found that it I don't use white and dark gray lines for borders, it looks much better, e.g only use dark gray. I think because my outer border line was white and inner was gray it had this weird artifact when moving camera around.
Yes, mip maps will make it look blurry, since they are a way to filter your textures. Without proper filtering you get sampling artefacts, they look the way you described it above.
Yes, dropping the white color will also reduce the artifacts, since only green or gray can get sampled.
Your answer
Follow this Question
Related Questions
Problems making game grid for space rts. (just visible to player not highlighting grid cells) 1 Answer
Generating and altering a mesh at runtime as a grid based terrain 3 Answers
how to quickly disable vertices from rendering in a Mesh? 1 Answer
How do I add grid lines to a material?,How do you add grid lines to a material? 1 Answer