Conversation
| m_state[i], (double)theta, (double)gamma, i) / 106.856980); // (sum of Spectrum::CIE_Y) | ||
| else { | ||
| Float step_size = (MTS_WAVELENGTH_MIN - MTS_WAVELENGTH_MIN) / (Float) Spectrum::Size; | ||
| Float wavelength0 = MTS_WAVELENGTH_MIN + step_size * i; |
There was a problem hiding this comment.
(When the time comes to use spectral mode), the wavelengths to evaluate are already specified in si.wavelength.
src/emitters/sky.cpp
Outdated
| } | ||
|
|
||
| for (size_t i = 0; i < Spectrum::Size; i++) | ||
| result[i] = max(result[i], 0.0f); |
There was a problem hiding this comment.
result = max(result, 0.f) should work (courtesy of Enoki).
src/emitters/sky.cpp
Outdated
| m_turbidity = props.float_("turbidity", 3.0f); | ||
| m_stretch = props.float_("stretch", 1.0f); | ||
| m_resolution = props.int_("resolution", 512); | ||
| m_albedo = props.texture<Texture>("albedo", 0.2f); |
There was a problem hiding this comment.
I'm surprised this works: m_albedo has a Spectrum type, but here the properties you query has type ref<Texture>.
If you try to print the value of albedo here, are you getting what you expect?
I think the correct usage would be to change the type of m_albedo to ref<Texture>, and then query it like so in your eval method:
mitsuba2/src/bsdfs/diffuse.cpp
Line 99 in f30bd5c
|
|
||
| for (size_t i = 0; i < Spectrum::Size; i++) { | ||
| if constexpr (Spectrum::Size == 3) | ||
| m_state[i] = arhosek_rgb_skymodelstate_alloc_init( |
There was a problem hiding this comment.
Since the model states are allocated here, they should also be freed in the destructor (arhosekskymodelstate_free, and corresponding in the spectral case).
| Float wavelength0 = MTS_WAVELENGTH_MIN + step_size * i; | ||
| Float wavelength1 = MTS_WAVELENGTH_MIN + step_size * (i+1); | ||
| result[i] = (Float) arhosekskymodel_radiance( | ||
| m_state[i], (double)theta, (double)gamma, 0.5f * (wavelength0 + wavelength1)); |
There was a problem hiding this comment.
You've probably already checked, but of course there's always the question of whether angles are expected in degrees or radians.
|
@merlinND can we close this PR? |
No description provided.