Skip to content

Commit 479c31f

Browse files
committed
edl optim
1 parent 0f38a37 commit 479c31f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/drawer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ void Drawer::edl()
424424

425425
const float zNear = 1;
426426
const float zFar = 10000;
427+
const float logzFar = std::log2(zFar);
427428

428429
std::vector<GLfloat> worldLogDistances(width * height);
429430
for (int i = 0; i < width * height; ++i)
@@ -455,9 +456,12 @@ void Drawer::edl()
455456
for (int x = 0; x < width; ++x)
456457
{
457458
int idx = y * width + x;
459+
float wld = worldLogDistances[idx];
460+
461+
if (wld == logzFar) { continue; }
458462

459463
// Find the maximum log depth among neighbors
460-
GLfloat maxLogDepth = std::max(0.0f, worldLogDistances[idx]);
464+
GLfloat maxLogDepth = std::max(0.0f, wld);
461465

462466
// Compute the response for the current pixel
463467
GLfloat sum = 0.0f;

0 commit comments

Comments
 (0)