diff options
author | Marius Kintel <marius@kintel.net> | 2013-01-08 18:24:54 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-01-08 18:24:54 (GMT) |
commit | 8cea6834f68cbbfb85c2568d388bf3b2e707cca5 (patch) | |
tree | 24d1cf90d6d234671a1c392e4ecd4becf34317c4 /src/polyset.cc | |
parent | d983ede35672b75d9d4e800fe913165846817e51 (diff) |
bugfix for recently introduced bug: Render negative 2D objects slightly thicker than positive objects to avoid z-buffer tearing with OpenCSG rendering
Diffstat (limited to 'src/polyset.cc')
-rw-r--r-- | src/polyset.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/polyset.cc b/src/polyset.cc index 3b3be34..e601585 100644 --- a/src/polyset.cc +++ b/src/polyset.cc @@ -157,7 +157,8 @@ void PolySet::render_surface(csgmode_e csgmode, const Transform3d &m, GLint *sha } #endif /* ENABLE_OPENCSG */ if (this->is2d) { - double zbase = 1; // Render 2D objects 1mm thick + // Render 2D objects 1mm thick, but differences slightly larger + double zbase = 1 + (csgmode & CSGMODE_DIFFERENCE_FLAG) * 0.1; glBegin(GL_TRIANGLES); for (double z = -zbase/2; z < zbase; z += zbase) { @@ -248,7 +249,8 @@ void PolySet::render_edges(csgmode_e csgmode) const { glDisable(GL_LIGHTING); if (this->is2d) { - double zbase = 1; // Render 2D objects 1mm thick + // Render 2D objects 1mm thick, but differences slightly larger + double zbase = 1 + (csgmode & CSGMODE_DIFFERENCE_FLAG) * 0.1; for (double z = -zbase/2; z < zbase; z += zbase) { for (size_t i = 0; i < borders.size(); i++) { |