-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for per-emitter sampling weight (#721)
This adds support for a per emitter `sampling_weight`, similar to Mitsuba 0.6. This allows specifying a non-uniform sampling for direct illumination. If no weights are specified, we revert back to the already existing uniform sampling and skip any extra complexity due to the non-uniform case.
- Loading branch information
Showing
11 changed files
with
195 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
#include <mitsuba/core/properties.h> | ||
#include <mitsuba/core/spectrum.h> | ||
#include <mitsuba/render/emitter.h> | ||
#include <mitsuba/render/endpoint.h> | ||
|
||
NAMESPACE_BEGIN(mitsuba) | ||
|
||
MI_VARIANT Emitter<Float, Spectrum>::Emitter(const Properties &props) | ||
: Base(props) {} | ||
: Base(props) { | ||
m_sampling_weight = props.get<ScalarFloat>("sampling_weight", 1.0f); | ||
} | ||
MI_VARIANT Emitter<Float, Spectrum>::~Emitter() { } | ||
|
||
MI_VARIANT | ||
void Emitter<Float, Spectrum>::traverse(TraversalCallback *callback) { | ||
callback->put_parameter("sampling_weight", m_sampling_weight, +ParamFlags::NonDifferentiable); | ||
} | ||
|
||
MI_VARIANT | ||
void Emitter<Float, Spectrum>::parameters_changed(const std::vector<std::string> &keys) { | ||
set_dirty(true); | ||
Base::parameters_changed(keys); | ||
} | ||
|
||
MI_IMPLEMENT_CLASS_VARIANT(Emitter, Endpoint, "emitter") | ||
MI_INSTANTIATE_CLASS(Emitter) | ||
NAMESPACE_END(mitsuba) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters