# How to eliminate line aliasing in an object made of cubes?

I have a big cube made of smaller cubes, but sometimes, due to the fact that each side of the cube has different colors, I get some ugly colored lines that I would like to get rid off. Any advice is appreciated.

EDIT: The BLACK lines and arrows are part of a texture, they are not relevant to my question, the focus is the RED line in the first picture and the red dots in the second picture. The lines appear mostly because this cube is made of smaller cubes put together side by side, so, depending on camera orientation, the side of a cube gets drawn on top of the front of the neighbouring cube.

EDIT: The solution, at least for now, was to "delete" all faces that are not visible, this, for obvious reasons, eliminated the problem, but I am going to leave this question open in case someone comes up with a solution that does not involve hiding faces.

• The arrows are there to point to the line which is the problem you are trying to solve right? – Alan Wolfe Nov 2 '17 at 16:30
• So... what exactly are those lines? Are they drawn via GL_LINES? Are they textures? – Nicol Bolas Nov 2 '17 at 22:52
• Sorry about thedelay, the black lines are not the issue, the issue are the red line and red dots. – Makogan Nov 3 '17 at 1:10
• Is it a HW renderer or software? One possible reason for this could be a lack of Z precision in that a red surface (though further away) is resulting in the same Z-buffer depth (due to limited precision) at a problematic pixel as the neighbouring cube's blue surface. Things you could try: 1) Move the front plane closer to the object to try to get more precision or 2) turn off "equals" in the Z test and draw all blue, then red & yellow surfaces. – Simon F Nov 3 '17 at 12:33
• Just to be clearer by "Move the front plane closer" I meant the front clipping plane. – Simon F Nov 3 '17 at 16:42