Getting started with rs_pbrt (Rust-based PBRT)

First blog entry for my new web site about the Rust based PBRT render:

More to come ... see also the about page:

The web page was done via Zola (previously called Gutenberg) (fast static site generator in a single binary with everything built-in) and the Hyde theme ... still learning how to use it.


In the meantime Gutenberg is called Zola and I added more things to digest:

  1. Using Blender for Scene Creation: Give a brief history about other Blender exporters I have written in the past and which one to use for rs-pbrt.

  2. Create a Triangle in Blender and Render it: Walk you through the simplest scene you possibly can render: a triangle (some geometry), a camera (to “see” something), and a light source (so your rendered image isn’t black). This assumes that you might be a newbee regarding the usage of Blender, but still has some valid information for people who know the GUI, but probably not the Python API. Something to get started, but future blog posts will not explain things in such a detail anymore …

  3. Workflow for using Blender in Python Console Mode: The Blender add-on I have written (and most likely have to re-write for Blender 2.8) is not meant to be a full integration with all the GUI for shaders etc. but rather a testbed to create scenes for rs-pbrt (and also other renderers). So here I divide the workflow into changing the scene within Blender using the GUI, exporting either there or in a non-GUI version of Blender (using a Python console), and finally rendering from the command line. Resulting images can be brought back into Blender or watched elsewhere.

I know this is the Rust forum, but the main executable to render (rs_pbrt) is written in Rust, I might split some parts into other libraries ( in the future, and I’m looking for participants (make the Rust version 100% compatible with the published book), add new technology (like denoising) etc. but also for people who want to teach about rendering and/or the Blender Python API (which I was once - in 2000/2001 - responsible for).

Anyway, just a quick update. I probably publish new versions of rs-pbrt on the new web site as well (as a blog post) and announce them here …


Thanks for your effort to bring PBRT inside the Rust ecosystem :slight_smile:

I will be interested in helping if the time permit. I am currently developing my rendering system based on Rust. To be able to compare with PBRT, I already integrating some part of your code.

I have also tried to split one part of your code into a library: pbrt_rs (might need to change the name as it can be quite confusing compared to your project name, though). The aim to this library is to be able to parse PBRT files and generate an abstract representation of the 3D scene. Then, this representation can be used in a custom rendering system to load the materials and so on. This library is only a subset of what your PBRT implementation can load for the moment. However, I guess, providing such a library can be useful for the community.

Concerning the denoiser, have you any idea how to proceed? In my experience, two nonmachine learning denoiser is interesting to integrate:

An example of how to integrate these denoisers (inside Mitsuba) can be found here.

1 Like

I’m glad to see you making progress with this project. I haven’t had much time to do much work on mine lately, unfortunately. I wonder if there are features in mine that are not in yours yet that I could contribute to yours? Working on it was great fun and I learned a ton, but it probably makes more sense in the future to focus on one version. What do you think?

seems down

I guess that would be now

Hi @beltegeuse,

Thanks for your effort to bring PBRT inside the Rust ecosystem :slight_smile:

Thanks. Good to know that some people like that. I spend far too much time on it, but I think it’s at a point where I do not want to drop it, rather find some people who want to work together to make it more complete.

Regarding the parser: I have an experimental implementation of a parser which can read Arnold’s scene description and use the (PBRT) render API to create images from it. It was meant to give me access to production scenes (@ The Mill, where I work), but I stopped working on it end of August because I got busy with other stuff. I think the parser part is already well separated. I do use the pest crate for parsers (at that time the C++ code used bison and flex), but in theory the .pbrt file format is so easy to parse that it also could be hand-coded (that’s what they decided to do with the original C++ code to get rid of further dependencies).

So, yes, I agree, parsing the scene description could be separated into a library which would be beneficial for a lot of people who do not want to deal with that part, but work e.g. on their own renderer. I would like to see a system where several parsers can read several scene descriptions (geometry should be relative easy). Materials are most of the time already renderer dependent. So, yes, would be nice to separate materials from the scene, just have somehow a binding which part of the geometry should use which material (however that will be defined). I think that’s part of the idea what they want to achieve with MaterialX.

I found the second paper you mention about denoising already, but I didn’t know (read) the paper from Benedikt Bitterli et al. There is also a working implementation for Blender’s Cycles renderer, where you could take the C++ code and turn it into a Rust variant to use.

Thanks for the link to the Mitsuba integration.


Hi @abusch,

I wonder if there are features in mine that are not in yours yet that I could contribute to yours? Working on it was great fun and I learned a ton, but it probably makes more sense in the future to focus on one version.

Yes, let’s combine our two Rust implementations. We should probably discuss it via email. I will have a closer look at your source code. I did clone your repository, but had problems to run the executable (or sometimes to compile it). Anyway, you started working on it first, and we attacked the problems slightly different, but I think it makes sense to work together. Do you have my email address? I will send it to you in a PM (just in case), so we can discuss things in more detail …

1 Like

… seems down

@Congee (and @abusch ), thanks for pointing this out, I changed both links (Zola & Hyde) above …