diff --git a/examples.c b/examples.c index e1a3799..2b48f77 100644 --- a/examples.c +++ b/examples.c @@ -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; diff --git a/raytrace.c b/raytrace.c index 1edd7c4..8024d0a 100644 --- a/raytrace.c +++ b/raytrace.c @@ -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++) { diff --git a/test.png b/test.png index f4ffba8..4d38794 100644 Binary files a/test.png and b/test.png differ