#pbrt #ray-tracing #pbrt-v4

pbrt4

Lightweight and fast PBRT v4 file parser

2 unstable releases

0.2.0 May 23, 2023
0.1.0 May 21, 2023

#1891 in Parser implementations

25 downloads per month

Apache-2.0

345KB
2K SLoC

pbrt4

CI Crates.io docs.rs Crates.io dependency status

A Rust crate to load pbrt-v4 files.

The scene description files used by pbrt are plain text files. The file format was designed so that it would be both easy to parse and easy for applications to generate from their own internal representations of scenes.

A pbrt scene file consists of a series of statements; different statements specify the geometry and light sources in the scene and set overall rendering parameters (such as which light transport algorithm to use or the image resolution).

Resources

Getting started

Add the following to your project's Cargo.toml:

pbrt4 = "0.1.0"

Reading a pbrt file is as easy as:

let scene = Scene::from_file("file.pbrt")?;

for shape in scene.shapes {
    println!("{:?}", shape)
}

Please refer to examples for more examples how to use the crate.

Dependencies

~3.5MB
~104K SLoC