How do we write a ray tracer in opengl?

This page summarizes the projects mentioned and recommended in the original post on /r/GraphicsProgramming

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • LearnOpenGL

    Code repository of all OpenGL chapters from the book and its accompanying website https://learnopengl.com

  • https://learnopengl.com/ is the standard beginner's reference

  • Book_of_Shaders

    not sad

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • RayTracer

    Ray Tracer in C++ with openGL. (by Meirshomron)

  • vulkan-compute-ray-tracing

    Interactive ray tracer made with Vulkan compute shader.

  • It's better to use a compute shader than fragment because it's better parallelizable. The idea is the same as with fragment shader, you just use compute to write into a texture. I have done something similar in Vulkan, you can take a look: https://github.com/grigoryoskin/vulkan-compute-ray-tracing https://github.com/grigoryoskin/vulkan-compute-ray-tracing/blob/master/resources/shaders/source/ray-trace-compute.comp

  • clray

    Realtime GPU (OpenCL) polygon mesh raytracer

  • But this is all very awkward and pointless. Pixel shaders are not designed for that, and textures are not ideal for passing such information to the GPU. Ideally, you would use OpenGL compute shaders, or any other GPU compute API, and pass your geometry in "buffers". I've written a polygon mesh raytracer like that in OpenCL once upon a time: https://github.com/jtsiomb/clray

  • RayTracingInVulkan

    Implementation of Peter Shirley's Ray Tracing In One Weekend book using Vulkan and NVIDIA's RTX extension.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts