long runtime bild
This commit is contained in:
+2
-2
@@ -36,7 +36,7 @@ void exampleSphere( int width, int height, int channels, unsigned char **image)
|
|||||||
cam1.screenDistance = 1;
|
cam1.screenDistance = 1;
|
||||||
cam1.width = 1.920;
|
cam1.width = 1.920;
|
||||||
cam1.height = 1.080;
|
cam1.height = 1.080;
|
||||||
vec3 sphereOrigin = (vec3){0,0,5};
|
vec3 sphereOrigin = (vec3){0,-2,5};
|
||||||
double sphereRadius = 1.0;
|
double sphereRadius = 1.0;
|
||||||
sphere obj1 = (sphere){sphereOrigin, sphereRadius,(RGBA){1,0.5,1,1},0};
|
sphere obj1 = (sphere){sphereOrigin, sphereRadius,(RGBA){1,0.5,1,1},0};
|
||||||
sphere **objectList = (sphere **) calloc(5+1, sizeof(sphere*));;
|
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;
|
objectList[2] = &obj3;
|
||||||
sphere obj4 = (sphere){vec3Add(sphereOrigin, (vec3){1,1,3}), sphereRadius, (RGBA){0.5,1,1,1},0};
|
sphere obj4 = (sphere){vec3Add(sphereOrigin, (vec3){1,1,3}), sphereRadius, (RGBA){0.5,1,1,1},0};
|
||||||
objectList[3] = &obj4;
|
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;
|
objectList[4] = &light1;
|
||||||
int objectCount = 5;
|
int objectCount = 5;
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -7,12 +7,12 @@
|
|||||||
|
|
||||||
RGBA raytraceSphere(sphere **objectList, ray *lightray) {
|
RGBA raytraceSphere(sphere **objectList, ray *lightray) {
|
||||||
RGBA pixel = (RGBA){0,0,0,0};
|
RGBA pixel = (RGBA){0,0,0,0};
|
||||||
#define lightBounces 1
|
#define lightBounces 3
|
||||||
//sphere **spheresHitList = (sphere **)calloc( (lightBounces + 1),sizeof(sphere*) );
|
//sphere **spheresHitList = (sphere **)calloc( (lightBounces + 1),sizeof(sphere*) );
|
||||||
//vec3 *spheresNormalList = (vec3 *)calloc( lightBounces + 1,sizeof(vec3) );
|
//vec3 *spheresNormalList = (vec3 *)calloc( lightBounces + 1,sizeof(vec3) );
|
||||||
int hitLightIndex = -1;
|
int hitLightIndex = -1;
|
||||||
vec3 sphereNormal;
|
vec3 sphereNormal;
|
||||||
int raysPerPixel = 50;
|
int raysPerPixel = 2000;
|
||||||
ray originalRay = *lightray;
|
ray originalRay = *lightray;
|
||||||
|
|
||||||
for (int k = 0; k < raysPerPixel; k++) {
|
for (int k = 0; k < raysPerPixel; k++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user