mitsuba-renderer / mitsuba

Mitsuba renderer main repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Any simple way of doing single wavelength (narrowband) rendering?

felipegb94 opened this issue · comments

Dear Mitsuba Developers,

I want to only render in a narrow spectral range (e.g. 810nm to 850nm). The spectrum of the emitter and the sensor would be in that range. And since I am only interested in those wavelengths I could also only specify the reflectance of the objects of the scene in that wavelength range. Is there a simple way to do this?

I believe this is easy to do in the emitter settings. I can simply set the spectrum values to something like values=800:0, 810:1, 830:3, 850:1, 860:0.

On the sensor side, however, I could do the same. But if I understand the documentation correctly, even if I set the spectrum values of the sensor to something like the values above, the actual rendered values will depend on the number of SPECTRUM_SAMPLES set at compile time (which by default it is 3).

As a follow-up question. If the SPECTRUM_SAMPLES is set to 3 then which wavelengths are rendered? Would it be 3 evenly spaced wavelength between 360nm and 830nm? So R would correspond to 828nm, G to 672nm, and B to 516nm?

Thank you!
Felipe

I tried the following and it seems to be doing what I want to do.

  1. Set SPECTRUM_MIN_WAVELENGTH and SPECTRUM_MAX_WAVELENGTH in spectrum.h to 810nm and 850nm, respectively.
  2. Set -DSPECTRUM_SAMPLES to 1 in config.py.
  3. Recompile Misuba

Now I tried the following setup. Set maxDepth = 1 and have an emitter shining light directly into the sensor. It looks like the sensor will integrate the light in the SPECTRUM_RANGE and output a single value since we are only taking a single spectrum sample. Here is a few examples of what I observe.

  • Setting the emitter spectrum to values = 810:0, 811:1, 812:0 gives me a measured value of 1 in the sensor
  • Setting the emitter spectrum to values = 829:0, 830:1, 831:0 also gives me a measured value of 1 in the sensor
  • Setting the emitter spectrum to values = 810:0, 811:1, 812:0, 829:0, 830:1, 831:0 also gives me a measured value of 2 in the sensor

From the above examples I conclude that what Mitsuba is doing is integrating over the spectrum range and reporting the result of the integration.

I noticed that if I try to specify a spectrumProperty for the sensor I get the following warning: Unqueried attribute "spectrumProperty" in element "sensor". So I am guessing there isn't really a way to input a custom spectral response for the sensor other than uniform. Does that sound right?