2021-08-10 02:11:22 +02:00
|
|
|
RayHit trace(Ray ray)
|
|
|
|
{
|
|
|
|
RayHit hit = createRayHit();
|
|
|
|
|
|
|
|
Sphere s;
|
2022-01-30 23:01:02 +01:00
|
|
|
s.cr = vec4(0.0,0.0,0.0,5.0);
|
2021-08-10 02:11:22 +02:00
|
|
|
s.albedo = vec3(1.0,0.0,0.0);
|
2022-01-30 23:01:02 +01:00
|
|
|
s.material = MAT_CHROME;
|
|
|
|
intersectSphere(ray, hit, s);
|
2021-08-10 02:11:22 +02:00
|
|
|
|
|
|
|
intersectPlane(ray, hit, vec3(0.0,-1.5,0.0),vec3(0.0,1.0,0.0));
|
|
|
|
|
|
|
|
for (int i = 0; i < _activeSpheres; i++)
|
|
|
|
{
|
|
|
|
intersectSphere(ray, hit, _spheres[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hit;
|
|
|
|
}
|