All Projects → ekzhang → Rpt

ekzhang / Rpt

Licence: other
A physically-based path tracer

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Rpt

Yocto Gl
Yocto/GL: Tiny C++ Libraries for Data-Driven Physically-based Graphics
Stars: ✭ 1,391 (+369.93%)
Mutual labels:  graphics, rendering, 3d-graphics, physically-based-rendering
Tinyraytracer
A brief computer graphics / rendering course
Stars: ✭ 3,971 (+1241.55%)
Mutual labels:  graphics, rendering, 3d-graphics
f3d
Fast and minimalist 3D viewer.
Stars: ✭ 791 (+167.23%)
Mutual labels:  rendering, 3d-graphics, physically-based-rendering
Rs pbrt
Rust crate to implement a counterpart to the PBRT book's (3rd edition) C++ code. See also https://www.rs-pbrt.org/about ...
Stars: ✭ 619 (+109.12%)
Mutual labels:  graphics, rendering, physically-based-rendering
Renderhelp
⚡️ 可编程渲染管线实现,帮助初学者学习渲染
Stars: ✭ 494 (+66.89%)
Mutual labels:  graphics, rendering, 3d-graphics
Overload
3D Game engine with editor
Stars: ✭ 335 (+13.18%)
Mutual labels:  graphics, 3d-graphics, physically-based-rendering
Hybridrenderingengine
Clustered Forward/Deferred renderer with Physically Based Shading, Image Based Lighting and a whole lot of OpenGL.
Stars: ✭ 563 (+90.2%)
Mutual labels:  graphics, 3d-graphics, physically-based-rendering
Softwarerenderer
Software rendering engine with PBR. Built from scratch on C++.
Stars: ✭ 323 (+9.12%)
Mutual labels:  graphics, 3d-graphics, physically-based-rendering
Renderer
A shader-based software renderer written from scratch in C89
Stars: ✭ 1,366 (+361.49%)
Mutual labels:  graphics, rendering, 3d-graphics
Tinyraycaster
486 lines of C++: old-school FPS in a weekend
Stars: ✭ 1,383 (+367.23%)
Mutual labels:  graphics, rendering, 3d-graphics
Flycube
Graphics API wrapper is written in C++ on top of Directx 12 and Vulkan. Provides main features including ray tracing.
Stars: ✭ 78 (-73.65%)
Mutual labels:  graphics, rendering, 3d-graphics
Tinykaboom
A brief computer graphics / rendering course
Stars: ✭ 2,077 (+601.69%)
Mutual labels:  graphics, rendering, 3d-graphics
Tinyrenderer
A brief computer graphics / rendering course
Stars: ✭ 11,776 (+3878.38%)
Mutual labels:  graphics, rendering, 3d-graphics
Vxr
General purpose engine written in C++ with emphasis on materials rendering (PBR, clear coat, anisotropy, iridescence)
Stars: ✭ 181 (-38.85%)
Mutual labels:  graphics, rendering, physically-based-rendering
nub
A rendering and interaction Processing library
Stars: ✭ 28 (-90.54%)
Mutual labels:  rendering, 3d-graphics
Photon-v2
A program that takes photographs of a virtual world.
Stars: ✭ 75 (-74.66%)
Mutual labels:  rendering, physically-based-rendering
delphi3d-engine
A 3D-graphic and game engine for Delphi and Windows.
Stars: ✭ 52 (-82.43%)
Mutual labels:  rendering, 3d-graphics
Gg
Go Graphics - 2D rendering in Go with a simple API.
Stars: ✭ 3,162 (+968.24%)
Mutual labels:  graphics, rendering
coin
Coin3D core library
Stars: ✭ 193 (-34.8%)
Mutual labels:  rendering, 3d-graphics
Edxray
A physically based renderer which implements many state of the art techniques in light transport simulation, material modeling, sampling and reconstruction.
Stars: ✭ 270 (-8.78%)
Mutual labels:  graphics, rendering

rpt

Latest Version API Documentation

This is a physically based, CPU-only rendering engine written in Rust. It uses path tracing to generate realistic images of 3D scenes.

Demo renders Demo video

Features

  • Simple declarative API, 100% Safe Rust
  • Supports .OBJ, .MTL, and .STL file formats
  • Uses unbiased path tracing for physically-based light transport
  • Uses a microfacet BSDF model with multiple importance sampling
  • Uses kd-trees to accelerate ray intersections
  • Supports direct light sampling and emissive materials
  • Supports HDRI environment maps
  • Supports depth of field
  • Supports iterative rendering, variance estimation, and firefly reduction
  • Supports physics simulation with numerical integrators and particle systems
  • Uses all CPU cores concurrently, scaling linearly up to 96 cores

Quickstart

First, clone the repository. The library containing path tracing code is located inside src/. Example code and scenes are located in examples/. To compile and run examples/basic.rs, use the command:

cargo run --example basic

To run tests, use:

cargo test

Library Usage

To use rpt as a library, add the following to your Cargo.toml:

[dependencies]
rpt = "0.2"

Here's a simple scene that demonstrates the basics of the API.

use rpt::*;

fn main() {
    let mut scene = Scene::new();

    scene.add(Object::new(sphere())); // default red material
    scene.add(
        Object::new(plane(glm::vec3(0.0, 1.0, 0.0), -1.0))
            .material(Material::diffuse(hex_color(0xAAAAAA))),
    );
    scene.add(Light::Object(
        Object::new(
            sphere()
                .scale(&glm::vec3(2.0, 2.0, 2.0))
                .translate(&glm::vec3(0.0, 12.0, 0.0)),
        )
        .material(Material::light(hex_color(0xFFFFFF), 40.0)),
    ));

    let camera = Camera::look_at(
        glm::vec3(-2.5, 4.0, 6.5),
        glm::vec3(0.0, -0.25, 0.0),
        glm::vec3(0.0, 1.0, 0.0),
        std::f64::consts::FRAC_PI_4,
    );

    Renderer::new(&scene, camera)
        .width(960)
        .height(540)
        .max_bounces(2)
        .num_samples(100)
        .render()
        .save("output.png")
        .unwrap();
}

Example output

This code can also be found in examples/sphere.rs. Note that the shadow is correctly tinted red due to global illumination. See the detailed API documentation for information about all of the features, and feel free to learn from the other examples!

References

Samples

Dragon Cornell box Pegasus Lego plane Fractal spheres Rustacean Wine glass Spheres

Acknowledgements

This project was built by Eric Zhang and Alexander Morozov. We'd like to thank Justin Solomon, Yuanming Hu, Lingxiao Li, and Dmitriy Smirnov for teaching an excellent computer graphics class at MIT.

Some of the examples use free 3D models and image assets available on the Internet. Links are provided in comments in the source code, where used.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].