Lichtquellen wurden falsch gehändelt weshalb die farbe manchmal overflowed ist. das ganze wir jetzt anders gehändelt
This commit is contained in:
+5
-5
@@ -72,11 +72,11 @@ RGBA raytraceSphere(sphere **objectList, ray *lightray) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pixel.r += spheresHitList[firstLightHitIndex]->color.r;
|
//pixel.r += spheresHitList[firstLightHitIndex]->color.r;
|
||||||
pixel.g += spheresHitList[firstLightHitIndex]->color.g;
|
//pixel.g += spheresHitList[firstLightHitIndex]->color.g;
|
||||||
pixel.b += spheresHitList[firstLightHitIndex]->color.b;
|
//pixel.b += spheresHitList[firstLightHitIndex]->color.b;
|
||||||
pixel.a += spheresHitList[firstLightHitIndex]->color.a;
|
//pixel.a += spheresHitList[firstLightHitIndex]->color.a;
|
||||||
for (int i = firstLightHitIndex - 1; i >= 0; i--) {
|
for (int i = firstLightHitIndex; i >= 0; i--) {
|
||||||
tempPixel.r = tempPixel.r * spheresHitList[i]->color.r;
|
tempPixel.r = tempPixel.r * spheresHitList[i]->color.r;
|
||||||
tempPixel.g = tempPixel.g * spheresHitList[i]->color.g;
|
tempPixel.g = tempPixel.g * spheresHitList[i]->color.g;
|
||||||
tempPixel.b = tempPixel.b * spheresHitList[i]->color.b;
|
tempPixel.b = tempPixel.b * spheresHitList[i]->color.b;
|
||||||
|
|||||||
Reference in New Issue
Block a user