Multispectral Imaging

153 views
Skip to first unread message

Aksel

unread,
Mar 11, 2011, 1:54:52 PM3/11/11
to pbrt
Hi,

First off, PBRT is a great piece of software, thanks a lot!

For PhD research i would need to be able to render multispectral data,
ideally with PBRT. That means greyscale images of a scene containing
each a slice of 10nm spectra bin, i.e. img01_400-410nm,
img02_410-420nm, ..., img30_690-700nm.

Would anyone know if there by chance are versions of PBRT modules
tailored to that use? If not, what would be your rough hint where to
start such a modification? I have to add i am very experienced in 3d
rendering and ok comfortable working with PBRT, and able to code on a
rookie/intermediate basis, but am no C++ wiz by any means.

Thanks a lot for your input,
Aksel

Matt Pharr

unread,
Mar 23, 2011, 8:46:05 AM3/23/11
to pb...@googlegroups.com
The version of pbrt in the second edition of the book (aka 'pbrt-v2') has infrastructure for doing full-spectral rendering. First, go to line ~143 in core/pbrt.h and comment out the first 'Spectrum' typedef and un-comment-out the second, so that you have:

//typedef RGBSpectrum Spectrum;
typedef SampledSpectrum Spectrum;

Then it will use the SampledSpectrum class in core/spectrum.h for all spectral computations. These settings at the top of that file control the number of bins and the wavelength range used:

static const int sampledLambdaStart = 400;
static const int sampledLambdaEnd = 700;
static const int nSpectralSamples = 30;

The one thing you will need to do by yourself is write a new Film implementation to write out the results. If you do the above, it will do all of the intermediate rendering calculations with the full-spectral representation, but will then convert to XYZ and then RGB to write out an image. Check out film/image.{h,cpp} to see how it does that now; using that code as a starting point would probably make sense.

-matt

> --
> You received this message because you are subscribed to the Google Groups "pbrt" group.
> To post to this group, send email to pb...@googlegroups.com.
> To unsubscribe from this group, send email to pbrt+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pbrt?hl=en.
>

Parastoo Farajpoor

unread,
Jan 20, 2024, 1:05:00 PM1/20/24
to pbrt
Hi! 

I wanted to first also mention that PBRT is great! Thank you.

I have kind of the same problem: I want to render a multispectral scene, but I am using verison 4 of PBRT. Does this process applies to version 4?

Thank you.

Matt Pharr

unread,
Jan 22, 2024, 2:28:53 PM1/22/24
to pbrt
pbrt-v4 is not only spectral by default, but that's now the only option for the light transport computations. (RGB may still be used for textures/colors specified as part of the scene and RGB output is the only option at the moment.)
Reply all
Reply to author
Forward
0 new messages