fixxed global illumination, aber bin mir nicht besser ob es besser ist, weil wirr jetzt farbliche noise haben. ausserdem ist dort immer noch schwarz. das sollte gar nicht mehr moeglich sein, was zeigt dass lichtstrahlen escapen

This commit is contained in:
any
2026-08-26 17:45:04 +02:00
parent d3b7b1b4b7
commit 586758c1e8
2 changed files with 6 additions and 4 deletions
+6 -4
View File
@@ -7,9 +7,9 @@
#include "helper.h"
#include <math.h>
#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;
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1013 KiB

After

Width:  |  Height:  |  Size: 1.5 MiB