Commits

Cliff Biffle committed 3193df0

Adjusted falloff so far objects are clearer when GL lighting is disabled.

Comments (0)

Files changed (1)

 	cross_product(&a, &b, out);
 }
 
+#define FALLOFF (9.F)
+
 - (void) drawDepthFieldAsTris: (NSData *)field 
                     usingMode: (GLenum)mode 
                     baseColor: (const vec3f_t *)color {
         }
         
         vec3f_t coord = correctPerspective(x, y + step, d);
-        GLfloat color = 1.F - (d / 6.F);
+        GLfloat color = 1.F - (d / FALLOFF);
         
         compute_normal(&prev[0], &prev[1], &coord, &normal);
         glNormal3fv(&normal.x);
         maxDepth = fmaxf(maxDepth, d);
         
         coords[i] = correctPerspective(xs[i], ys[i], d);
-        colors[i] = 1.F - (d / 6.F);
+        colors[i] = 1.F - (d / FALLOFF);
       }
       
       if (fabsf(minDepth - maxDepth) > 0.4F) skip = YES;
         if (d < 0.1F) skip = YES;
         
         coords[i] = correctPerspective(xs[i], ys[i], d);
-        colors[i] = 1.F - (d / 6.F);
+        colors[i] = 1.F - (d / FALLOFF);
       }
       
       if (skip) continue;
       
       vec3f_t coord = correctPerspective(x, y, d1);
       
-      GLfloat c = 1.F - (d1/7.F);
+      GLfloat c = 1.F - (d1/FALLOFF);
       if (!lightsOn) glColor3f(c, c, c);
       
       const GLfloat off = 1.F + d1;
       
       vec3f_t coords = correctPerspective(x, y, d1);
       
-      GLfloat c = 1.F - (d1 / 6.F);
-      glColor3f(c, c, c);
+      GLfloat c = 1.F - (d1 / FALLOFF);
+      if (!lightsOn) glColor3f(c, c, c);
       
       glVertex3fv(&coords.x);
     }