diff --git a/raytrace.c b/raytrace.c index 1c07901..e25c134 100644 --- a/raytrace.c +++ b/raytrace.c @@ -72,11 +72,11 @@ RGBA raytraceSphere(sphere **objectList, ray *lightray) { } else { - pixel.r += spheresHitList[firstLightHitIndex]->color.r; - pixel.g += spheresHitList[firstLightHitIndex]->color.g; - pixel.b += spheresHitList[firstLightHitIndex]->color.b; - pixel.a += spheresHitList[firstLightHitIndex]->color.a; - for (int i = firstLightHitIndex - 1; i >= 0; i--) { + //pixel.r += spheresHitList[firstLightHitIndex]->color.r; + //pixel.g += spheresHitList[firstLightHitIndex]->color.g; + //pixel.b += spheresHitList[firstLightHitIndex]->color.b; + //pixel.a += spheresHitList[firstLightHitIndex]->color.a; + for (int i = firstLightHitIndex; i >= 0; i--) { tempPixel.r = tempPixel.r * spheresHitList[i]->color.r; tempPixel.g = tempPixel.g * spheresHitList[i]->color.g; tempPixel.b = tempPixel.b * spheresHitList[i]->color.b; diff --git a/test.png b/test.png index d172143..26dd57a 100644 Binary files a/test.png and b/test.png differ