Code two function to get the expected result as attached image (screen shot)
1. bool sphereIntersect(Ray ray, int sphereIndex, inout HitInfo hitInfo) and
2. vec3 itera=veRayTrace(Ray ray) function (these function all in fragmentShader.c, you can search “su do” to find functions, in Visual Studio project file attached)
Hello,
I'm a game engine programmer and have lots of experience in raytracing, having written both fast path tracer and primary-ray packet ray tracer. This task is very straightforward, you would get a clear and simple solution very fastly.