diff --git a/raytrace.c b/raytrace.c index c3eea55..7480ff9 100644 --- a/raytrace.c +++ b/raytrace.c @@ -27,11 +27,11 @@ RGBA getRayColor(RGBA colorList[], bool isLightList[]) { if (firstLightHitIndex == -1) { //rayColor = (RGBA){GLOBALILLUMINATION * colorList[0].r,GLOBALILLUMINATION * colorList[0].g,GLOBALILLUMINATION * colorList[0].b,1}; - rayColor = (RGBA){0,0,0,1}; - return rayColor; + //rayColor = (RGBA){0,0,0,1}; + //return rayColor; + isLightList[lightBounces - 1] = 1; + colorList[lightBounces - 1] = (RGBA){1,1,1,1}; } - else - { //pixel.r += spheresHitList[firstLightHitIndex]->color.r; //pixel.g += spheresHitList[firstLightHitIndex]->color.g; //pixel.b += spheresHitList[firstLightHitIndex]->color.b; @@ -46,7 +46,7 @@ RGBA getRayColor(RGBA colorList[], bool isLightList[]) { //pixel.r = -vec3Product(sphereNormal, lightray->direction); //pixel = (RGBA){1 - 0.5 *( sphereNormal.x + 1), 1 - 0.5 * (sphereNormal.y +1), 1 -0.5* (sphereNormal.z + 1),1}; return rayColor; - } + } diff --git a/test.png b/test.png index cd7912b..ae14dd6 100644 Binary files a/test.png and b/test.png differ