• Stars
    star
    529
  • Rank 83,810 (Top 2 %)
  • Language
    Rust
  • License
    Other
  • Created about 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A small path tracing renderer written in Rust.

rayn

This is a CPU-based path tracing renderer focused on rendering SDFs, specifically fractals. It was originally based on the book "Ray tracing in one weekend" by Peter Shirley, which I heartily recommend, though it has now evolved into a structure of my own design, taking hints from that, pbrt, which is also an excellent reference, and research from NVIDIA on wavefront pathtracing for taking advantage of SIMD.

Features

  • Architected to use 128-wide SIMD to full extent with the help of ultraviolet, and in the future perhaps 256 or 512 as well.
  • Physical light transport algorithm
  • Multiple-bounce indirect lighting/global illumination
  • Importance sampling (soon multiple importance sampling)
  • Next Event Estimation / Direct light sampling
  • Depth of field
  • Arbitrary animation and time-sampled motion blur
  • Signed distance field rendering through leveraging sdfu
  • Homogeneous volumetrics with extinction and single scattering with isotropic media

Demo images

All demo images in this repository are licensed under the CC BY-NC-ND license which essentially means you are free to use them for non-commercial purposes so long as you:

1. Credit me (my name, Gray Olson, and a link to my website, https://grayolson.me/)

2. Do not modify them

CC BY-NC-ND License Badge

If you wish to use them for commercial purposes, contact me and we can work out a license.

demo7 demo1 Full 8k resolution image of this render available here.

How to use it

Building

First, install Rust. Then, clone or download this repo (green "Code" button on GitHub). Finally, open a shell prompt and change to this repository's directory (if you're not sure how to do this, see this article). Then, run

$ cargo run --release

This will render an image and place it in a folder called renders inside the folder this repo is in.

Playing with the scene

With your favorite code editor (I recommend VSCode with the rust-analyzer plugin), open the src/setup.rs file.

Here you can change many settings including the resolution of the output image, the number of indirect lighting bounces, the number of raymarching steps on each path, the number of total samples to take, and the setup of the whole scene. Feel free to play with all these numbers and see what they do. Just run cargo run --release each time you make a change to render a new image. There are some comments in that file to help you get started on things you can play around with.

More demo images

demo2 demo3 demo4 demo5 demo6

More Repositories

1

ultraviolet

A wide linear algebra crate for games and graphics.
Rust
738
star
2

rendy-pbr

PBR rendering example/experiment with rendy
Rust
224
star
3

sdfu

Signed Distance Field Utilities
Rust
116
star
4

i3-vim-nav

Seamlessly navigate i3 windows and vim splits
Go
99
star
5

colstodian

An opinionated, practical color management library for games and graphics.
Rust
34
star
6

nano-rs

An implementation of Nano in Rust using Tokio
Rust
28
star
7

ggez_snake

Rust
25
star
8

cint

A lean, minimal, and stable set of types for color interoperation between crates in Rust.
Rust
19
star
9

CCBullet3D

An easy-to-use wrapper in the Cocos/Objective-C style to integrate the robust, C++ physics library "Bullet" with Cocos3D.
C++
16
star
10

gfx-hal-tutorial

Rust
15
star
11

hot

A mid-level Vulkan abstraction library for the experts and the masses.
Rust
10
star
12

rgba

Reasonably Good Bluetooth Audio - A tiny, inline Bluetooth audio receiver for IEMs.
8
star
13

rmpt2d

A 2d ray-marching path-tracer in Processing
Processing
7
star
14

luluu

A cute and smart arm warmer sleeve ^_^
Rust
6
star
15

CCBullet3D-Sample

Sample use of the CCBullet3D wrapper.
C++
5
star
16

giftrogue

Small roguelike in rust/tcod as part of a gift to someone.
Rust
4
star
17

rayn2d

Rust
4
star
18

dotfiles

My dotfiles managed by yadm
Lua
4
star
19

nanopow-rs-node

A JavaScript wrapper for nanopow-rs to provide fast, safe, fully multithreaded Nano proof-of-work generation in Node.js.
Rust
4
star
20

egui-color-picker-oklab

Rust
3
star
21

simple-rayn

A simple raytracing renderer written in Rust.
Rust
3
star
22

thunderclap

A ray marching experiment in Zig
C
3
star
23

nano-base32

A small, quick, self-contained implementation of the Base32 encoding/decoding scheme used by the cryptocurrency Nano.
JavaScript
3
star
24

linmath.zig

Small, computer-graphics focused linear algebra library for Zig
Zig
3
star
25

fu5ha

2
star
26

vsps

Casing & power supply design for VSPS (Very Simple Phono Stage) by RJM Audio
2
star
27

nanowarpwallet

A Nano brain wallet generator that uses scrypt.
JavaScript
2
star
28

p5.Asteroids

Asteroids implementation in p5.js
JavaScript
1
star
29

TicTacToe-Ruby

A simple, two-player, command-line Tic Tac Toe game.
Ruby
1
star
30

grayolson.me

JavaScript
1
star
31

graphics-experiments

C#
1
star
32

rust-toh

A simple, terminal-interface Towers of Hanoi simulator in Rust
Rust
1
star
33

CheckpointTitler

An OpenPlanet plugin to automatically update your Twitch stream title with your current checkpoint status when playing RPG or trial maps.
AngelScript
1
star