oglc/shader/include/scene.glsl

16 lines
279 B
Plaintext
Raw Normal View History

2021-08-10 02:11:22 +02:00
RayHit trace(Ray ray)
{
RayHit hit = createRayHit();
// floor
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));
// spheres
2021-08-10 02:11:22 +02:00
for (int i = 0; i < _activeSpheres; i++)
{
intersectSphere(ray, hit, _spheres[i]);
}
return hit;
}