<p>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.</p>

<p><a href="https://i.sstatic.net/6T6R9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6T6R9.png" alt="enter image description here"></a></p>

<p><a href="https://i.sstatic.net/qGpZs.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qGpZs.png" alt="enter image description here"></a></p>

<p>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.</p>

<p>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.</p>

CC BY-SA 3.0
2017-11-02T16:30:42.870Z
The arrows are there to point to the line which is the problem you are trying to solve right?
Alan Wolfe
CC BY-SA 3.0
2017-11-02T22:52:28.457Z
So... what exactly are those lines? Are they drawn via `GL_LINES`? Are they textures?
Nicol Bolas
CC BY-SA 3.0
2017-11-03T01:10:55.770Z
Sorry about thedelay, the black lines are not the issue, the issue  are the red line and red dots.
Makogan
CC BY-SA 3.0
2017-11-03T12:33:06.073Z
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
CC BY-SA 3.0
2017-11-03T16:42:17.637Z
Just to be clearer by "Move the front plane closer" I meant the front clipping plane.
Simon F
CC BY-SA 3.0
2017-11-03T23:47:18.773Z
Sounds like a Z-fighting issue? I don’t think OpenGL guarantees precise polygon rasterization.
Lawrence D'Oliveiro
<opengl><rendering><antialiasing>
How to eliminate line aliasing in an object made of cubes?
Makogan
# How to eliminate line aliasing in an object made of cubes?

(Asked by: username_0 on 2017-11-02)

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.

[![enter image description here](https://i.sstatic.net/6T6R9.png)](https://i.sstatic.net/6T6R9.png)

[![enter image description here](https://i.sstatic.net/qGpZs.png)](https://i.sstatic.net/qGpZs.png)

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.

**Tags:** opengl, rendering, antialiasing

> **Comments:**
> **username_1**: The arrows are there to point to the line which is the problem you are trying to solve right?  
> **username_2**: So... what exactly are those lines? Are they drawn via `GL_LINES`? Are they textures?  
> **username_0**: Sorry about thedelay, the black lines are not the issue, the issue  are the red line and red dots.  
> **username_3**: 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.  
> **username_3**: Just to be clearer by "Move the front plane closer" I meant the front clipping plane.  
> **username_4**: Sounds like a Z-fighting issue? I don’t think OpenGL guarantees precise polygon rasterization.  

---

## 0 answers

