1
\$\begingroup\$

I'm creating a minecraft clone (for practice), and I'm trying to implement a feature in which the block that the player is looking at has a block outline. The way I do this is just by creating a GL_LINES mesh that covers the edges of the block, and then translating it to the block position. I'm using the LibGDX framework to do this - the outline ends up producing a ModelInstance.

It partially works, but this is what it looks like:

enter image description here

As you can see, some of the pixels are getting rendered, but some aren't. My theory is that this is because of the depth buffer - because the line is intersecting with the face, some of the pixels don't get rendered. So my question is, how can I ensure that the outline gets rendered solidly?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Well, I think that is because the lines are exactly where the faces are. Try making the box of lines a fraction bigger than the block itself.

\$\endgroup\$
2
  • \$\begingroup\$ This should be a comment not an answer since it's speculate and requires additional input from the asker. \$\endgroup\$
    – Charanor
    Jun 18, 2017 at 13:44
  • \$\begingroup\$ Well, I cannot be 100% sure, because I have no code. And I have the input in form of his own theory. \$\endgroup\$
    – Kiryu144
    Jun 18, 2017 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .