Skip to content

Simple recursive ray tracer written as a GLSL frament shader, loaded using C++ with OpenGL

Notifications You must be signed in to change notification settings

ruby0b/opengl-ray-tracer

Repository files navigation

OpenGL Ray Tracer

project screenshot

Running

The project is built most easily using the Nix package manager. Using Nix, we can compile this project without installing anything:

nix --extra-experimental-features "nix-command flakes" build github:ruby0b/opengl-ray-tracer

The result will be a single executable, located in ./result/bin/ray-tracer. Check out the command line parameters with --help.

If you are not on a NixOS system, chances are that the binary will fail to run due to Nix-related graphics driver issues. We can use nixGL to work around this though:

NIXPKGS_ALLOW_UNFREE=1 nix --extra-experimental-features "nix-command flakes" run --override-input nixpkgs nixpkgs/nixos-23.11 --impure github:nix-community/nixGL -- result/bin/ray-tracer

Development

You can enter a development shell with all the dependencies you need using:

nix develop

If you're using VSCode, install the clangd extension and disable the default C++ intellisense. For clangd to work, you'll need to generate build/compile_commands.json:

nix develop --command sh -c 'rm -rf build; cmake -B build'

About

Simple recursive ray tracer written as a GLSL frament shader, loaded using C++ with OpenGL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published