Skip to content

Commit

Permalink
Bugfix scalar_rgb crashing with incorrect distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
matttsss committed Feb 3, 2025
1 parent 588f860 commit 434d80b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/emitters/sunsky.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,12 @@ class SunskyEmitter final : public Emitter<Float, Spectrum> {
WAVELENGTHS<ScalarFloat>[NB_WAVELENGTHS - 1]
};

if constexpr (!dr::is_array_v<Float>)
if constexpr (!dr::is_array_v<Float>) {
// Mean ratio over the range of parameters (turbidity, sun angle)
// And uniform spectral sampling
return { 0.5f, ContinuousDistribution<Wavelength>(range, 1.f) };
else {
ScalarFloat distribution[2] = {1.f, 1.f};
return { 0.5f, ContinuousDistribution<Wavelength>(range, distribution, 2) };
} else {

FullSpectrum sky_radiance = dr::zeros<FullSpectrum>(),
sun_radiance = dr::zeros<FullSpectrum>();
Expand Down

0 comments on commit 434d80b

Please sign in to comment.