only reflections
This commit is contained in:
+3
-4
@@ -37,15 +37,14 @@ RGBA raytraceSphere(sphere **objectList, ray *lightray) {
|
||||
lightray->origin = nearestCollisionPoint;
|
||||
}
|
||||
else {
|
||||
sphereNormal = (vec3){0,0,0};
|
||||
sphereNormal = (vec3){1,1,1};
|
||||
}
|
||||
}
|
||||
|
||||
if (nearestSphere != nullptr)
|
||||
{
|
||||
|
||||
//pixel.r = -vec3Product(sphereNormal, lightray->direction);
|
||||
pixel = (RGBA){1 - 0.5 *( sphereNormal.x + 1), 1 - 0.5 * (sphereNormal.y +1), 1 -0.5* (sphereNormal.z + 1),1};
|
||||
}
|
||||
|
||||
free(spheresHitList);
|
||||
return pixel;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user