https://github.com/ruuda/convector
Interactive CPU path tracer
https://github.com/ruuda/convector
Last synced: about 1 year ago
JSON representation
Interactive CPU path tracer
- Host: GitHub
- URL: https://github.com/ruuda/convector
- Owner: ruuda
- License: gpl-3.0
- Created: 2016-05-10T15:37:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-07-19T20:41:55.000Z (almost 8 years ago)
- Last Synced: 2025-04-19T20:53:57.468Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 5.9 MB
- Stars: 45
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
Convector
=========
Interactive CPU path tracer.
[![Build Status][ci-img]][ci]
On the left: interactive mode, running at about 10 fps on my machine. On the
right: accumulative mode, after rendering for a few minutes.
| ![Interactive][interactive] | ![Accumulative][accumulative] |
|-----------------------------|-------------------------------|
Requirements
------------
Hardware: a CPU that supports the AVX instructions is required. In practice this
means Sandy Bridge or later. FMA instructions can be taken advantage of too,
those are Haswell or later.
Software: a recent nightly version of the
[Rust programming language](https://rust-lang.org) is required. Version 1.10 is
recommended. On Windows you need the version with the MSVC ABI.
Compiling and Running
---------------------
* `cargo run --release` to build and run the release executable.
* `cargo build --release` to build in release mode without running.
* `cargo bench` to build and run all benchmarks in release mode.
* `cargo test` to build and run all tests in debug mode.
If you do not want to use the FMA instructions, remove the `+fma` from the
codegen options in `.cargo/config`.
Controls
--------
* Press `b` to toggle blending recent frames.
* Press `d` to toggle debug view.
The green channel shows the number of primary AABB intersections,
the blue channel shows the number of primary triangle intersections.
* Press `m` to toggle the median filter for noise reduction.
* Press `q` to quit the application.
* Press `r` to switch between realtime and accumulative rendering.
* Press `s` to print statistics to the console.
* Press `t` to write a trace to trace.json.
It can be opened with Chrome by going to chrome://tracing.
About the code
--------------
Many structs represent eight instances at once for SIMD. In that case the name
has been prefixed with `M` (for “multi”). The single-instance struct types have
the prefix `S` instead (for “single”).
The most interesting stuff is in `src/triangle.rs`, `src/material.rs`,
and `src/renderer.rs`, and `src/bvh.rs`. Shaders are in `src/gpu`.
License
-------
Convector is free software. It is licensed under the
[GNU General Public License][gplv3], version 3.
[gplv3]: https://www.gnu.org/licenses/gpl-3.0.html
[interactive]: https://raw.githubusercontent.com/ruuda/convector/master/screenshots/interactive.png
[accumulative]: https://raw.githubusercontent.com/ruuda/convector/master/screenshots/accumulative.png
[ci-img]: https://ci.appveyor.com/api/projects/status/nkqhoi829382i1ow?svg=true
[ci]: https://ci.appveyor.com/project/ruuda/convector