Skip to content

Commit

Permalink
Fix mi.luminance() for monochromatic modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Speierers committed Oct 20, 2022
1 parent 4ebf700 commit 61b9516
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/mitsuba/core/spectrum.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,12 @@ dr::value_t<Spectrum> luminance(const Spectrum &value,
dr::mask_t<Spectrum> active = true) {
if constexpr (is_rgb_v<Spectrum>) {
DRJIT_MARK_USED(active);
DRJIT_MARK_USED(wavelengths);
return luminance(value);
} else if constexpr (is_monochromatic_v<Spectrum>) {
DRJIT_MARK_USED(active);
DRJIT_MARK_USED(wavelengths);
return value[0];
} else {
return dr::mean(cie1931_y(wavelengths, active) * value);
}
Expand Down

0 comments on commit 61b9516

Please sign in to comment.