Skip to content

Commit

Permalink
add bvh view to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gnikoloff committed Jan 14, 2024
1 parent 9fd2930 commit caaf8d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ There already exist WebGPU raytracers that do all the path tracing in a fragment

Testing each ray against each triangle compromising the scene is naive and slow. That's where accelerated structures such as BVH come into play. You wrap each object in a box and then recursively add more boxes for different parts of the object. Think about a person: you add a box surrounding them, then one box for each limb and one box for each finger. If the ray does not intersect the person you don't check any triangles in the libmbs or fingers. If it hits the right arm, you don't check the triangles in the left foot and so on. This significantly sped up the render times in this app.

![Bounding Volume Hierarchy visualisation](https://github.com/gnikoloff/webgpu-raytracer/blob/main/bvh.png?raw=true)

#### No textures, storage buffers instead

In order to store all the state that the raytracer needs, such as random number generation and image state, it's easier to use WebGPU storage buffers than textures, as you can place arbitrary data in a storage buffer.
Expand Down
Binary file added bvh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit caaf8d1

Please sign in to comment.