preview: allow forcing diffuse sources/receivers -- the latter is not done yet

metadata
Wenzel Jakob 2010-08-28 22:10:05 +02:00
parent e191ea43c9
commit c296248190
11 changed files with 171 additions and 100 deletions

View File

@ -46,11 +46,17 @@ public:
/// Is shadow map generation generation performed in a single pass?
inline bool isSinglePass() const { return m_singlePass; }
/// Set whether or not non-diffuse VPLs are permitted
inline void setAllowNonDiffuseVPLs(bool allowNonDiffuseVPLs) { m_allowNonDiffuseVPLs = allowNonDiffuseVPLs; }
/// Set whether or not non-diffuse VPLs are used
inline void setDiffuseSources(bool diffuseSources) { m_diffuseSources = diffuseSources; }
/// Are non-diffuse VPLs permitted? This is more realistic, but can take a long time to converge.
inline bool allowNonDiffuseVPLs() const { return m_allowNonDiffuseVPLs; }
/// Return whether or not non-diffuse VPLs are used
inline bool getDiffuseSources() const { return m_diffuseSources; }
/// Set whether or not surfaces are drawn assumed to be diffuse
inline void setDiffuseReceivers(bool diffuseReceivers) { m_diffuseReceivers = diffuseReceivers; }
/// Return whether or not surfaces are assumed to be diffuse
inline bool getDiffuseReceivers() const { return m_diffuseReceivers; }
/// Set the current shadow map resolution
inline void setShadowMapResolution(int resolution) { m_shadowMapResolution = resolution; }
@ -150,7 +156,8 @@ private:
bool hasLuminaire;
int param_shadowMap, param_vplPos, param_camPos, param_vplPower;
int param_vplN, param_vplS, param_vplT, param_vplWi, param_vplUV;
int param_nearClip, param_invClipRange, param_minDist, param_allowNonDiffuseVPLs;
int param_nearClip, param_invClipRange, param_minDist;
int param_diffuseSources, param_diffuseReceivers;
inline VPLProgramConfiguration() { }
@ -232,7 +239,8 @@ private:
ref<GPUTexture> m_shadowMap;
Float m_nearClip, m_invClipRange;
int m_shadowMapResolution;
bool m_singlePass, m_allowNonDiffuseVPLs;
bool m_singlePass;
bool m_diffuseSources, m_diffuseReceivers;
/* Rendering related */
std::map<std::string, ProgramAndConfiguration> m_programs;

View File

@ -8,7 +8,8 @@ MTS_NAMESPACE_BEGIN
VPLShaderManager::VPLShaderManager(const Scene *scene, Renderer *renderer)
: m_scene(scene), m_renderer(renderer), m_clamping(0.1f),
m_maxClipDist(std::numeric_limits<Float>::infinity()), m_initialized(false),
m_shadowMapResolution(512), m_singlePass(false), m_allowNonDiffuseVPLs(false) {
m_shadowMapResolution(512), m_singlePass(false),
m_diffuseSources(false), m_diffuseReceivers(false) {
}
VPLShaderManager::~VPLShaderManager() {
@ -320,7 +321,7 @@ void VPLShaderManager::configure(const VPL &vpl, const BSDF *bsdf, const Luminai
<< "uniform vec3 vplPower, vplS, vplT, vplN, vplWi;" << endl
<< "uniform float nearClip, invClipRange, minDist;" << endl
<< "uniform vec2 vplUV;" << endl
<< "uniform bool allowNonDiffuseVPLs;" << endl
<< "uniform bool diffuseSources, diffuseReceivers;" << endl
<< endl
<< "/* Inputs <- Vertex program */" << endl
<< "varying vec3 normal, tangent, lightVec, camVec;" << endl
@ -363,7 +364,7 @@ void VPLShaderManager::configure(const VPL &vpl, const BSDF *bsdf, const Luminai
<< " dot(vplT, nLightVec)," << endl
<< " dot(vplN, nLightVec));" << endl
<< " vec3 vplLo = vplPower;" << endl
<< " if (allowNonDiffuseVPLs)" << endl
<< " if (!diffuseSources)" << endl
<< " vplLo *= " << vplEvalName;
if (vpl.type == ESurfaceVPL)
oss << "(vplUV, vplWi, vplWo);" << endl;
@ -402,7 +403,8 @@ void VPLShaderManager::configure(const VPL &vpl, const BSDF *bsdf, const Luminai
m_targetConfig.param_nearClip = program->getParameterID("nearClip", false);
m_targetConfig.param_invClipRange = program->getParameterID("invClipRange", false);
m_targetConfig.param_minDist = program->getParameterID("minDist", false);
m_targetConfig.param_allowNonDiffuseVPLs = program->getParameterID("allowNonDiffuseVPLs", false);
m_targetConfig.param_diffuseSources = program->getParameterID("diffuseSources", false);
m_targetConfig.param_diffuseReceivers = program->getParameterID("diffuseReceivers", false);
m_current.program = program;
m_current.config = m_targetConfig;
m_programs[configName] = m_current;
@ -423,13 +425,13 @@ void VPLShaderManager::configure(const VPL &vpl, const BSDF *bsdf, const Luminai
if (vpl.type == ESurfaceVPL) {
program->setParameter(config.param_vplWi, vpl.its.wi);
program->setParameter(config.param_vplUV, vpl.its.uv);
program->setParameter(config.param_allowNonDiffuseVPLs, m_allowNonDiffuseVPLs);
program->setParameter(config.param_diffuseSources, m_diffuseSources);
}
if (!m_allowNonDiffuseVPLs && vpl.type == ESurfaceVPL)
program->setParameter(config.param_vplPower, vpl.P
* vpl.its.shape->getBSDF()->getDiffuseReflectance(vpl.its) * INV_PI);
else
program->setParameter(config.param_vplPower, vpl.P);
Spectrum power = vpl.P;
if (m_diffuseSources && vpl.type == ESurfaceVPL)
power *= vpl.its.shape->getBSDF()->getDiffuseReflectance(vpl.its) * INV_PI;
program->setParameter(config.param_vplPower, power);
program->setParameter(config.param_diffuseReceivers, m_diffuseReceivers);
program->setParameter(config.param_nearClip, m_nearClip);
program->setParameter(config.param_invClipRange, m_invClipRange);
program->setParameter(config.param_minDist, m_minDist);

View File

@ -132,7 +132,8 @@ struct SceneContext {
QSize windowSize, sizeIncrease;
Vector2i scrollOffset;
Float reinhardKey, reinhardBurn;
bool allowNonDiffuseVPLs;
bool diffuseSources;
bool diffuseReceivers;
/* Preview state */
std::deque<VPL> vpls;

View File

@ -297,13 +297,19 @@ void GLWidget::setShadowMapResolution(int res) {
}
}
void GLWidget::setAllowNonDiffuseVPLs(bool value) {
if (value != m_context->allowNonDiffuseVPLs) {
m_context->allowNonDiffuseVPLs = value;
void GLWidget::setDiffuseSources(bool value) {
if (value != m_context->diffuseSources) {
m_context->diffuseSources = value;
resetPreview();
}
}
void GLWidget::setDiffuseReceivers(bool value) {
if (value != m_context->diffuseReceivers) {
m_context->diffuseReceivers = value;
resetPreview();
}
}
void GLWidget::setPreviewMethod(EPreviewMethod method) {
if (method != m_context->previewMethod) {

View File

@ -58,7 +58,8 @@ public slots:
void setGamma(bool srgb, Float gamma);
void setReinhardKey(Float value);
void setReinhardBurn(Float value);
void setAllowNonDiffuseVPLs(bool value);
void setDiffuseSources(bool value);
void setDiffuseReceivers(bool value);
void setExposure(Float exposure);
void onException(const QString &what);
void onScroll();

View File

@ -921,7 +921,8 @@ void MainWindow::on_actionPreviewSettings_triggered() {
connect(&d, SIGNAL(reinhardBurnChanged(Float)), ui->glView, SLOT(setReinhardBurn(Float)));
connect(&d, SIGNAL(previewMethodChanged(EPreviewMethod)), ui->glView, SLOT(setPreviewMethod(EPreviewMethod)));
connect(&d, SIGNAL(toneMappingMethodChanged(EToneMappingMethod)), ui->glView, SLOT(setToneMappingMethod(EToneMappingMethod)));
connect(&d, SIGNAL(allowNonDiffuseVPLsChanged(bool)), ui->glView, SLOT(setAllowNonDiffuseVPLs(bool)));
connect(&d, SIGNAL(diffuseReceiversChanged(bool)), ui->glView, SLOT(setDiffuseReceivers(bool)));
connect(&d, SIGNAL(diffuseSourcesChanged(bool)), ui->glView, SLOT(setDiffuseSources(bool)));
d.setMaximumSize(d.minimumSize());
d.exec();
QSettings settings("mitsuba-renderer.org", "qtgui");
@ -934,7 +935,8 @@ void MainWindow::on_actionPreviewSettings_triggered() {
settings.setValue("preview_clamping", context->clamping);
settings.setValue("preview_previewMethod", context->previewMethod);
settings.setValue("preview_toneMappingMethod", context->toneMappingMethod);
settings.setValue("preview_allowNonDiffuseVPLs", context->allowNonDiffuseVPLs);
settings.setValue("preview_diffuseReceivers", context->diffuseReceivers);
settings.setValue("preview_diffuseSources", context->diffuseSources);
#else
if (!m_previewSettings) {
m_previewSettings = new PreviewSettingsDlg(this);
@ -974,7 +976,8 @@ void MainWindow::onPreviewSettingsClose() {
settings.setValue("preview_clamping", context->clamping);
settings.setValue("preview_previewMethod", context->previewMethod);
settings.setValue("preview_toneMappingMethod", context->toneMappingMethod);
settings.setValue("preview_allowNonDiffuseVPLs", context->allowNonDiffuseVPLs);
settings.setValue("preview_diffuseSources", context->diffuseSources);
settings.setValue("preview_diffuseReceivers", context->diffuseReceivers);
}
}
@ -1605,7 +1608,8 @@ SceneContext::SceneContext(SceneContext *ctx) {
scrollOffset = ctx->scrollOffset;
reinhardKey = ctx->reinhardKey;
reinhardBurn = ctx->reinhardBurn;
allowNonDiffuseVPLs = ctx->allowNonDiffuseVPLs;
diffuseReceivers = ctx->diffuseReceivers;
diffuseSources = ctx->diffuseSources;
}
SceneContext::~SceneContext() {

View File

@ -356,7 +356,8 @@ void PreviewThread::run() {
m_shaderManager->setShadowMapResolution(m_context->shadowMapResolution);
m_shaderManager->setClamping(m_context->clamping);
m_shaderManager->setSinglePass(m_context->previewMethod == EOpenGLSinglePass);
m_shaderManager->setAllowNonDiffuseVPLs(m_context->allowNonDiffuseVPLs);
m_shaderManager->setDiffuseSources(m_context->diffuseSources);
m_shaderManager->setDiffuseReceivers(m_context->diffuseReceivers);
if (m_timer->getMilliseconds() > 1000) {
Float count = m_vplsPerSecond / (Float) m_timer->getMilliseconds() * 1000;

View File

@ -56,7 +56,8 @@ PreviewSettingsDialog::PreviewSettingsDialog(QWidget *parent, SceneContext *ctx,
ui->clampingSlider->setValue(clamping);
ui->gammaSpinBox->setValue(ctx->gamma);
ui->sRGBCheckBox->setCheckState(ctx->srgb ? Qt::Checked : Qt::Unchecked);
ui->nonDiffuseVPLBox->setCheckState(ctx->allowNonDiffuseVPLs ? Qt::Checked : Qt::Unchecked);
ui->diffuseSourcesBox->setCheckState(ctx->diffuseSources ? Qt::Checked : Qt::Unchecked);
ui->diffuseReceiversBox->setCheckState(ctx->diffuseReceivers ? Qt::Checked : Qt::Unchecked);
ui->previewMethodCombo->setModel(new MethodModel(this,
cap->isSupported(RendererCapabilities::EGeometryShaders)));
ui->previewMethodCombo->setCurrentIndex(ctx->previewMethod);
@ -65,6 +66,7 @@ PreviewSettingsDialog::PreviewSettingsDialog(QWidget *parent, SceneContext *ctx,
? ctx->exposure : ctx->reinhardBurn)*100));
m_ignoreEvent = false;
ui->keySlider->setValue((int) ((ctx->reinhardKey-REINHARD_MIN)/REINHARD_RANGE * 100));
ui->diffuseReceiversBox->setEnabled(ui->diffuseSourcesBox->isChecked());
on_previewMethodCombo_activated(ctx->previewMethod);
on_toneMappingMethodCombo_activated(ctx->toneMappingMethod);
@ -88,7 +90,8 @@ void PreviewSettingsDialog::on_resetButton_clicked() {
ui->keySlider->setValue((int) ((0.18-REINHARD_MIN)/REINHARD_RANGE * 100));
ui->sRGBCheckBox->setCheckState(Qt::Checked);
ui->nonDiffuseVPLBox->setCheckState(Qt::Unchecked);
ui->diffuseSourcesBox->setCheckState(Qt::Checked);
ui->diffuseReceiversBox->setCheckState(Qt::Unchecked);
}
void PreviewSettingsDialog::on_keySlider_valueChanged(int value) {
@ -139,8 +142,17 @@ void PreviewSettingsDialog::on_sRGBCheckBox_stateChanged(int state) {
emit gammaChanged(state == Qt::Checked, (Float) ui->gammaSpinBox->value());
}
void PreviewSettingsDialog::on_nonDiffuseVPLBox_stateChanged(int state) {
emit allowNonDiffuseVPLsChanged(state == Qt::Checked);
void PreviewSettingsDialog::on_diffuseReceiversBox_stateChanged(int state) {
emit diffuseReceiversChanged(state == Qt::Checked);
}
void PreviewSettingsDialog::on_diffuseSourcesBox_stateChanged(int state) {
emit diffuseSourcesChanged(state == Qt::Checked);
if (state == Qt::Unchecked && ui->diffuseReceiversBox->isChecked()) {
emit diffuseReceiversChanged(Qt::Unchecked);
ui->diffuseReceiversBox->setCheckState(Qt::Unchecked);
}
ui->diffuseReceiversBox->setEnabled(state == Qt::Checked);
}
void PreviewSettingsDialog::on_previewMethodCombo_activated(int index) {

View File

@ -26,7 +26,8 @@ signals:
void toneMappingMethodChanged(EToneMappingMethod method);
void reinhardKeyChanged(Float key);
void reinhardBurnChanged(Float burn);
void allowNonDiffuseVPLsChanged(bool);
void diffuseReceiversChanged(bool);
void diffuseSourcesChanged(bool);
protected slots:
void on_pathLengthSlider_valueChanged(int value);
@ -36,7 +37,8 @@ protected slots:
void on_exposureSpinBox_valueChanged(double value);
void on_gammaSpinBox_valueChanged(double value);
void on_sRGBCheckBox_stateChanged(int state);
void on_nonDiffuseVPLBox_stateChanged(int state);
void on_diffuseReceiversBox_stateChanged(int state);
void on_diffuseSourcesBox_stateChanged(int state);
void on_resetButton_clicked();
void on_previewMethodCombo_activated(int index);
void on_toneMappingMethodCombo_activated(int index);

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>414</width>
<height>382</height>
<width>428</width>
<height>379</height>
</rect>
</property>
<property name="windowTitle">
@ -239,6 +239,27 @@ p, li { white-space: pre-wrap; }
</item>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_6">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When a scene contains many glossy surfaces, the real-time visualization can sometimes produce disturbing image artifacts (bright blotches).&lt;span style=&quot; font-weight:600;&quot;&gt; &lt;/span&gt;These eventually disappear as the preview converges, but waiting for a long time may be undesirable. The following options are meant to reduce such issues:&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Diffuse sources&lt;/span&gt;: treat glossy surfaces at the second bounce as if they were diffuse. This is usually perfectly fine for previewing purposes and is thus turned on by default.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Diffuse receivers&lt;/span&gt;: treat directly visible surfaces as if they were diffuse. This is leads to a much more approximate result -- essentially, a clay version of the scene is being rendered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>&amp;Force diffuse :</string>
</property>
<property name="buddy">
<cstring>diffuseSourcesBox</cstring>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="font">
@ -298,6 +319,33 @@ p, li { white-space: pre-wrap; }
</item>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="keyLabel">
<property name="text">
<string>Key value : </string>
</property>
</widget>
</item>
<item row="8" column="2" colspan="2">
<widget class="QSlider" name="keySlider">
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLabel" name="exposureLabel">
<property name="text">
<string>E&amp;xposure : 2 ^</string>
</property>
<property name="buddy">
<cstring>exposureSpinBox</cstring>
</property>
</widget>
</item>
<item row="9" column="2" rowspan="2" colspan="2">
<layout class="QGridLayout" name="subGridLayout">
<item row="0" column="0">
@ -386,6 +434,16 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="10" column="1">
<widget class="QLabel" name="gammaLabel">
<property name="text">
<string>&amp;Gamma :</string>
</property>
<property name="buddy">
<cstring>gammaSpinBox</cstring>
</property>
</widget>
</item>
<item row="11" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
@ -466,77 +524,51 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="8" column="1">
<widget class="QLabel" name="keyLabel">
<property name="text">
<string>Key value : </string>
</property>
</widget>
</item>
<item row="8" column="2" colspan="2">
<widget class="QSlider" name="keySlider">
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLabel" name="exposureLabel">
<property name="text">
<string>E&amp;xposure : 2 ^</string>
</property>
<property name="buddy">
<cstring>exposureSpinBox</cstring>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLabel" name="gammaLabel">
<property name="text">
<string>&amp;Gamma :</string>
</property>
<property name="buddy">
<cstring>gammaSpinBox</cstring>
</property>
</widget>
</item>
<item row="5" column="2" colspan="2">
<widget class="QCheckBox" name="nonDiffuseVPLBox">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="diffuseSourcesBox">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When a scene contains many glossy surfaces, the real-time visualization can sometimes produce disturbing image artifacts (bright blotches).&lt;span style=&quot; font-weight:600;&quot;&gt; &lt;/span&gt;These eventually disappear as the preview converges, but waiting for a long time may be undesirable.&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When a scene contains many glossy surfaces, the real-time visualization can sometimes produce disturbing image artifacts (bright blotches).&lt;span style=&quot; font-weight:600;&quot;&gt; &lt;/span&gt;These eventually disappear as the preview converges, but waiting for a long time may be undesirable. The following options are meant to reduce such issues:&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;For this reason, the real-time visualiztaion will by default treat glossy surfaces at the second bounce as if they were diffuse, which is usually perfectly fine for previewing purposes. This behavior can optionally be disabled using this switch.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Allow non-diffuse point sources</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_6">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Diffuse sources&lt;/span&gt;: treat glossy surfaces at the second bounce as if they were diffuse. This is usually perfectly fine for previewing purposes and is thus turned on by default.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Diffuse receivers&lt;/span&gt;: treat directly visible surfaces as if they were diffuse. This is leads to a much more approximate result -- essentially, a clay version of the scene is being rendered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Sources</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="diffuseReceiversBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When a scene contains many glossy surfaces, the real-time visualization can sometimes produce disturbing image artifacts (bright blotches).&lt;span style=&quot; font-weight:600;&quot;&gt; &lt;/span&gt;These eventually disappear as the preview converges, but waiting for a long time may be undesirable.&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When a scene contains many glossy surfaces, the real-time visualization can sometimes produce disturbing image artifacts (bright blotches).&lt;span style=&quot; font-weight:600;&quot;&gt; &lt;/span&gt;These eventually disappear as the preview converges, but waiting for a long time may be undesirable. The following options are meant to reduce such issues:&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;For this reason, the real-time visualiztaion will by default treat glossy surfaces at the second bounce as if they were diffuse, which is usually perfectly fine for previewing purposes. This behavior can optionally be disabled using this switch.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>&amp;Other :</string>
</property>
<property name="buddy">
<cstring>nonDiffuseVPLBox</cstring>
</property>
</widget>
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Diffuse sources&lt;/span&gt;: treat glossy surfaces at the second bounce as if they were diffuse. This is usually perfectly fine for previewing purposes and is thus turned on by default.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Diffuse receivers&lt;/span&gt;: treat directly visible surfaces as if they were diffuse. This is leads to a much more approximate result -- essentially, a clay version of the scene is being rendered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Receivers</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
@ -546,7 +578,8 @@ p, li { white-space: pre-wrap; }
<tabstop>pathLengthEdit</tabstop>
<tabstop>clampingSlider</tabstop>
<tabstop>shadowResolutionCombo</tabstop>
<tabstop>nonDiffuseVPLBox</tabstop>
<tabstop>diffuseSourcesBox</tabstop>
<tabstop>diffuseReceiversBox</tabstop>
<tabstop>toneMappingMethodCombo</tabstop>
<tabstop>keySlider</tabstop>
<tabstop>exposureSpinBox</tabstop>
@ -565,8 +598,8 @@ p, li { white-space: pre-wrap; }
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>403</x>
<y>371</y>
<x>417</x>
<y>368</y>
</hint>
<hint type="destinationlabel">
<x>167</x>

View File

@ -31,7 +31,8 @@ void SceneLoader::run() {
m_result->clamping = (Float) settings.value("preview_clamping", 0.1f).toDouble();
m_result->previewMethod = (EPreviewMethod) settings.value("preview_previewMethod", EOpenGL).toInt();
m_result->toneMappingMethod = (EToneMappingMethod) settings.value("preview_toneMappingMethod", EGamma).toInt();
m_result->allowNonDiffuseVPLs = settings.value("preview_allowNonDiffuseVPLs", false).toBool();
m_result->diffuseSources = settings.value("preview_diffuseSources", true).toBool();
m_result->diffuseReceivers = settings.value("preview_diffuseReceivers", false).toBool();
if (endsWith(lowerCase, ".exr")) {
/* This is an image, not a scene */