<p>You have several techniques.</p>

<ol>
<li>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 <a href="https://www.scratchapixel.com/lessons/advanced-rendering/introduction-acceleration-structure" rel="nofollow noreferrer">here</a>.</li>
<li>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).</li>
<li>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.</li>
</ol>

<p>These are just some ideas. </p>

CC BY-SA 3.0
2017-02-04T17:54:24.943Z
Thanks for taking out some time for answering the question!
videogamechef
CC BY-SA 3.0
2017-02-04T17:37:22.263Z
2017-02-04T17:37:22.263Z
user18490
<p>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.</p>

<raytracing><shading><ray>
How can i make my ray tracing algorithm fast in terms of intersection testing?
videogamechef
# How can i make my ray tracing algorithm fast in terms of intersection testing?

(Asked by: username_0 on 2017-02-04)

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.

**Tags:** raytracing, shading, ray


---

## 1 answers

### Answer by username_1 on 2017-02-04. Score: 4

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](https://www.scratchapixel.com/lessons/advanced-rendering/introduction-acceleration-structure).
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.

> **Comments:**
> **username_0**: Thanks for taking out some time for answering the question!  

---

