0

I'm a noobie graphics programmer who wants to implement ray tracing with GPUs. Since rasterization is faster in means of rendering, I thought it'd be better to render g-buffer first and compute ray-traced illumination from it, using compute shader.

However, I'm not sure how to approach ray tracing in shader; traversing BVH for ray collision check is essential for ray tracing, although sending all the object data in the scene to the VRAM doesn't seem very viable(such as, what if there are millions of triangles in the scene?). Is there a known implementation of such case? If not, how should I tackle this problem?

박배추
  • 3
  • 4
  • this [raytrace through 3D mesh](https://stackoverflow.com/a/45140313/2521214) is a simple GLSL version ray tracer using native GL pipeline (no compute shader). However I am passing the geometry data as 2D texture. You can use that as a start point or as an inspiration. However no BVH yet... If you need more data you can use 3D texture instead (I am doing that for voxel ray tracer link is in there) – Spektre Jul 07 '20 at 08:17
  • @Spektre Thank you for the explanation, I guess I should try with textures. – 박배추 Jul 09 '20 at 02:49

0 Answers0