diff --git a/5GoodResult.png b/5GoodResult.png new file mode 100644 index 0000000..743aaa5 Binary files /dev/null and b/5GoodResult.png differ diff --git a/interface.c b/interface.c index 2609671..3bfd617 100644 --- a/interface.c +++ b/interface.c @@ -68,14 +68,23 @@ void *workerLoop(void *arg) { } void* monitorProgress(void *arg) { + double oldProgress = 0.0000001; MonitorArgs *args = (MonitorArgs*)arg; + double actualTime = 0; while (1){ + clock_t startTime = clock(); int pixelId = *atomic_load(&args->nextPixelId); if (pixelId >= args->pixelCount) break; double progress = 100.0 * pixelId / args->pixelCount; - printf("progress: %lf%%\n", progress); + double progressDiff = progress - oldProgress; + double estimatedTime = actualTime * 100/progressDiff; + double estimatedRestTime = actualTime * 1 / progressDiff * (100-progress); + printf("progress: %lf%%; et rest: %lfs; et gesamt: %lfs\n", progress, estimatedRestTime, estimatedTime); + oldProgress = progress; SLEEP_SECONDS(1); + clock_t endTime = clock(); + actualTime = (double)(endTime - startTime) / CLOCKS_PER_SEC; } return NULL; } diff --git a/raytrace.c b/raytrace.c index d51ba3a..9bebadf 100644 --- a/raytrace.c +++ b/raytrace.c @@ -7,8 +7,8 @@ #include "helper.h" #include #define epsilon 1e-8 -#define RAYSPERPIXEL 100 -#define lightBounces 6 +#define RAYSPERPIXEL 400 +#define lightBounces 16 #define GLOBALILLUMINATION 0.3 enum objectType { SPHERETYPE, diff --git a/test.png b/test.png index 4c6e7b1..743aaa5 100644 Binary files a/test.png and b/test.png differ