Commits

Cliff Biffle committed 8eed4b1

Tri renderer now disconnects at Z-discontinuities.

  • Participants
  • Parent commits bcac29e

Comments (0)

Files changed (1)

   for (int y = 0; y < 479; y++) {
     glBegin(GL_TRIANGLE_STRIP);
     BOOL inStrip = YES;
+    GLfloat lastDepth = depths[y * 640];
     for (int x = 0; x < 640; x++) {
       
       for (int step = 0; step < 2; step++) {
         GLfloat d = depths[(y + step) * 640 + x];
+        GLfloat deltaZ = fabsf(d - lastDepth);
+        lastDepth = d;
         
-        if (d < 0.1F) {
-          // Hole in the data.
+        if (d < 0.1F || deltaZ > 0.4F) {
+          // Hole in the data or depth discontinuity.
           if (inStrip) {
             glEnd();
             inStrip = NO;