Fixed raytracing algorithm