diff --git a/raytrace.c b/raytrace.c index 7480ff9..9b7c88f 100644 --- a/raytrace.c +++ b/raytrace.c @@ -7,9 +7,9 @@ #include "helper.h" #include #define epsilon 1e-8 -#define RAYSPERPIXEL 40 +#define RAYSPERPIXEL 10 #define lightBounces 5 -#define GLOBALILLUMINATION 0.1 +#define GLOBALILLUMINATION 0.4 enum objectType { SPHERETYPE, QUADTYPE @@ -29,8 +29,10 @@ RGBA getRayColor(RGBA colorList[], bool isLightList[]) { //rayColor = (RGBA){GLOBALILLUMINATION * colorList[0].r,GLOBALILLUMINATION * colorList[0].g,GLOBALILLUMINATION * colorList[0].b,1}; //rayColor = (RGBA){0,0,0,1}; //return rayColor; - isLightList[lightBounces - 1] = 1; - colorList[lightBounces - 1] = (RGBA){1,1,1,1}; + firstLightHitIndex = lightBounces - 1; + isLightList[firstLightHitIndex] = 1; + colorList[firstLightHitIndex] = (RGBA){GLOBALILLUMINATION,GLOBALILLUMINATION,GLOBALILLUMINATION,1}; + //colorList[firstLightHitIndex] = (RGBA){0,0,0,1}; } //pixel.r += spheresHitList[firstLightHitIndex]->color.r; //pixel.g += spheresHitList[firstLightHitIndex]->color.g; diff --git a/test.png b/test.png index ae14dd6..4962aba 100644 Binary files a/test.png and b/test.png differ