# Edges drop out when rendered at a long distance

I have this weird effect when rendering small objects at a long distance. I already tried using anisotropic filtering but maybe I am not doing it right.

Material script:

material Platform/Border
{
technique
{
pass
{
ambient 0 1 0.824 1.0
cull_hardware none
cull_software none
lighting on
texture_unit
{
filtering anisotropic
max_anisotropy 8
texture white-pixel.png
}
}
}
}


Screenshots:

How to solve this?

• Are you talking about the edges of the cuboids missing? Looks like mipmapping issues.
– House
Aug 27, 2013 at 18:39
• @Byte56 Yes, the edges look distorted (some parts are black where they should be greenish) Aug 27, 2013 at 18:47
• And it changes based on the distance and angle of the camera? Check out this question: gamedev.stackexchange.com/questions/30275/…
– House
Aug 27, 2013 at 18:48
• For this kind of look I imagine you'd get better results by drawing the edges explicitly using lines, rather than relying on a texture. Aug 27, 2013 at 18:53
• @Pacha Can you edit the question to describe more how you're building the boxes? If the edges are done with polygons, it might help to make them wider as the box gets further away, trying to ensure they always appear at least 1 pixel wide on screen. Aug 27, 2013 at 20:05

Now, since you're using Ogre, I have a feeling that none of the more sophisticated solutions I outlined are going to work for you. One last ditch effort would be to exaggerate the width of the border in your outline texture in lower mipmap levels (assuming Ogre gives you control over the mipmaps). Also make sure you use a clamp to edge address/wrap mode.