Lichtquellen wurden falsch gehändelt weshalb die farbe manchmal overflowed ist. das ganze wir jetzt anders gehändelt

This commit is contained in:
any
2026-07-30 18:23:21 +02:00
parent 2ebc5f03bb
commit 9681137e5a
2 changed files with 5 additions and 5 deletions
+5 -5
View File
@@ -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;
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB