This thesis explores the data structure known as sparse voxel octree and how it can improve the performance of real-time ray tracing. While ray tracing is an excellent way of producing realistic effects in computer graphics it is also very computationally heavy. Its use in real-time applications such as games and simulators is therefore limited since the hardware must be able to render enough frames per second to satisfy the users. The purpose of an octree is to reduce the amount of intersection tests each ray needs significantly. This thesis will explain the many challenges when implementing and using an octree, and also how to solve them. This includes both how to build the tree using various tests and then also how to use it with a ray t...