I wrote the code for checking intersection of ray and meshes on scene. It consist of two parts - broad phase and narrow phase. In broad phase I build an oriented bounding box around each mesh and check intersection of ray with boxes. In narrow phase I check intersection of ray and each triangle of the meshes from broad phase using Möller-Trumbore algorithm. In general it works well. Now my task is to optimize broad phase using Octree. Octree as data structure is well-described and trivial enough. However, I have no idea how to apply it for raytracing and I can't find nothing about it. Could you please give me a hint?

  • 1
    $\begingroup$ Try reading "Raytracing Complex Scenes" by Kajiya. $\endgroup$ – gallickgunner May 31 at 9:25
  • $\begingroup$ @gallickgunner Assuming you meant Kay and Kajiya's paper, I'm not sure it suggests using Octrees, but they do cite earlier works by Glassner and Kaplan which do, e.g. Glassner's "Space Subdivision for Fast Ray Tracing," IEEE Computer Graphics and Applications, Oct 1984 $\endgroup$ – Simon F May 31 at 11:22
  • $\begingroup$ @SimonF - Yeah, Kajiya doesn't explain what an octree is but defines a whole algorithm (using a heap) how to go about using it in raytracing. And I think that's what the OP wanted, that's why. $\endgroup$ – gallickgunner Jun 1 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.