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

enter image description here

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.

  • 1
    $\begingroup$ The arrows are there to point to the line which is the problem you are trying to solve right? $\endgroup$ – Alan Wolfe Nov 2 '17 at 16:30
  • $\begingroup$ So... what exactly are those lines? Are they drawn via GL_LINES? Are they textures? $\endgroup$ – Nicol Bolas Nov 2 '17 at 22:52
  • $\begingroup$ Sorry about thedelay, the black lines are not the issue, the issue are the red line and red dots. $\endgroup$ – Makogan Nov 3 '17 at 1:10
  • $\begingroup$ 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. $\endgroup$ – Simon F Nov 3 '17 at 12:33
  • $\begingroup$ Just to be clearer by "Move the front plane closer" I meant the front clipping plane. $\endgroup$ – Simon F Nov 3 '17 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.