Skip to content

DarkAce65/raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

raytracer

A ray tracer written in Rust which implements Blinn-Phong shading and physically-based rendering using a Metallic-Roughness workflow.

References

Building/Running

Requires that Rust and cargo are installed.

  • For a live visualization of the ray tracer, run cargo run -- scenes/scene.json
  • To output to a file, run cargo run -- -o image.png scenes/scene.json

Additional sample scene files are in the scenes folder.

OIDN support

This raytracer also has support for a post-processing pass using Intel's Open Image Denoise library to smooth noisy renders. To enable this feature, first download the library. Then run one of the following commands with the path to the folder containing the OIDN library

  • For a live visualization of the ray tracer, run

    OIDN_DIR=<path to OIDN dir> cargo run --features=denoise -- scenes/scene.json

  • To output to a file, run

    OIDN_DIR=<path to OIDN dir> cargo run --features=denoise -- -o image.png scenes/scene.json

Renders

See the full list of renders here.

scenes/scene.json (800 x 800 pixels, 4 spp, 1,524 primitives, 147,115,715 rays, 51.451s on i7 8650U)

scene.json


raytrace usage

The following options may be passed through cargo like so: cargo run -- [FLAGS] [OPTIONS] <scene>

ray tracer
A ray tracer written in Rust

USAGE:
    raytrace [FLAGS] [OPTIONS] <scene>

FLAGS:
    -h, --help           Prints help information
        --no-progress    Hide progress bar
    -V, --version        Prints version information

OPTIONS:
    -o, --output <output>    Output rendered image to file
                             If omitted, image is rendered to a window

ARGS:
    <scene>    input scene as a json file

About

A raytracer written in Rust

Resources

License

Stars

Watchers

Forks

Languages