Crates.io | pbrt4 |
lib.rs | pbrt4 |
version | 0.2.0 |
source | src |
created_at | 2023-05-21 23:03:18.80713 |
updated_at | 2023-05-23 04:09:37.271857 |
description | Lightweight and fast PBRT v4 file parser |
homepage | |
repository | https://github.com/mxpv/pbrt4 |
max_upload_size | |
id | 870180 |
size | 363,069 |
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).
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.