long runtime bild

This commit is contained in:
any
2026-07-30 01:27:24 +02:00
parent e0096dce11
commit 82ab538095
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -36,7 +36,7 @@ void exampleSphere( int width, int height, int channels, unsigned char **image)
cam1.screenDistance = 1;
cam1.width = 1.920;
cam1.height = 1.080;
vec3 sphereOrigin = (vec3){0,0,5};
vec3 sphereOrigin = (vec3){0,-2,5};
double sphereRadius = 1.0;
sphere obj1 = (sphere){sphereOrigin, sphereRadius,(RGBA){1,0.5,1,1},0};
sphere **objectList = (sphere **) calloc(5+1, sizeof(sphere*));;
@@ -47,7 +47,7 @@ void exampleSphere( int width, int height, int channels, unsigned char **image)
objectList[2] = &obj3;
sphere obj4 = (sphere){vec3Add(sphereOrigin, (vec3){1,1,3}), sphereRadius, (RGBA){0.5,1,1,1},0};
objectList[3] = &obj4;
sphere light1 = (sphere){(vec3){1,2,4.5}, sphereRadius, (RGBA){1,1,1,1},1};
sphere light1 = (sphere){(vec3){1,1,4.5}, sphereRadius, (RGBA){1,1,1,1},1};
objectList[4] = &light1;
int objectCount = 5;
+2 -2
View File
@@ -7,12 +7,12 @@
RGBA raytraceSphere(sphere **objectList, ray *lightray) {
RGBA pixel = (RGBA){0,0,0,0};
#define lightBounces 1
#define lightBounces 3
//sphere **spheresHitList = (sphere **)calloc( (lightBounces + 1),sizeof(sphere*) );
//vec3 *spheresNormalList = (vec3 *)calloc( lightBounces + 1,sizeof(vec3) );
int hitLightIndex = -1;
vec3 sphereNormal;
int raysPerPixel = 50;
int raysPerPixel = 2000;
ray originalRay = *lightray;
for (int k = 0; k < raysPerPixel; k++) {
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 KiB

After

Width:  |  Height:  |  Size: 739 KiB