Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Latest commit

 

History

History
42 lines (31 loc) · 1.76 KB

README.md

File metadata and controls

42 lines (31 loc) · 1.76 KB

gpu-raytracer

A simple raytracer which runs on the GPU. Written in Rust using Vulkano. The GPU code is run as a compute shader using the Vulkan API.

Preview

preview-GIF

Capabilities

  • Can render spheres and planes
  • Both spherical and directional light sources
  • Reflective and refractive surfaces
  • Movable camera (controlled using arrow keys)

Dependencies

  • Rust
  • Vulkan
  • Vulkano has its own set of dependencies (see here)

Running

Often computers will have both an integrated GPU and a discrete GPU, the latter of which you are more likely to want to use. To prevent the program from defaulting to the wrong device, run cargo run -- -l to list available devices and their corresponding index. Note the index of the device you want to use, and then run cargo run -- -d <index> to run the program with that device.

Full list of command line arguments:

FLAGS:
        --help            Prints help information
    -l, --list-devices    List the physical devices available to Vulkan and their corresponding index
    -V, --version         Prints version information

OPTIONS:
    -d, --device <device>            Specify the index of the physical device for Vulkan to use
    -f, --frame <output-filename>    Export as a PNG rather than opening a new window
    -h, --height <height>            Specify the height in pixels. Default is 500
    -t, --time <time>                Set the time parameter of the shader to this value in seconds. Useful when you want
                                     to take a screen-shot at the specified time
    -w, --width <width>              Specify the width in pixels. Default is 500