Skip to content

Commit

Permalink
Making it easier to pick meshes in the editor (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Interrupt authored Sep 11, 2020
1 parent b2ac704 commit 0415e4e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1560,14 +1560,20 @@ private void RenderEntitiesForPicking() {
renderer.Tesselate(level);
renderer.renderWorld(level);

Gdx.gl.glDisable(GL20.GL_POLYGON_OFFSET_FILL);
// Pull the vertices a bit closer to the camera this time around, to stop z-fighting with the depth of
// previously drawn objects.
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
Gdx.gl.glEnable(GL20.GL_POLYGON_OFFSET_FILL);
Gdx.gl.glPolygonOffset(-0.15f, 1);

// LEQUAL
Gdx.gl20.glDisable(GL20.GL_CULL_FACE);

renderer.renderEntitiesForPicking(level);
pickerFrameBuffer.end();

// Put things back to normal
Gdx.gl.glDisable(GL20.GL_POLYGON_OFFSET_FILL);
}

private void refreshTriangleSpatialHash() {
Expand Down

0 comments on commit 0415e4e

Please sign in to comment.