1
$\begingroup$

I am working on a ray tracer. But i want to put more than 10 objects in the scene. How can i make the intersection fast so that it can give me reasonable FPS. Its a cpu-based ray tracer.

$\endgroup$
4
$\begingroup$

You have several techniques.

  1. Use acceleration structures. The idea is that you store your geometry (triangles) into generally some kind of volumes. The general idea behind acceleration structure is to discard quickly large parts of the scene, which we know (using these structure) don't have any object that your ray will intersect. An introduction to the topic can be found here.
  2. You can also take advantage of multi-threading and parallelism (threads and SSE instructions or similar - this is harder than 1. and the benefits are not always as high but you optimise for your hardware).
  3. You can ray-trace in the GPU but ray-tracing is a memory-bound problem so you will have memory problems quicker with the GPU than with CPU.

These are just some ideas.

$\endgroup$
  • $\begingroup$ Thanks for taking out some time for answering the question! $\endgroup$ – Ankit singh kushwah Feb 4 '17 at 17:54
  • $\begingroup$ @Ankit np, the rules are that you accept this as an answer if you do;) $\endgroup$ – user18490 Feb 5 '17 at 10:29

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.