a few bugfixes

metadata
Wenzel Jakob 2011-07-29 03:29:11 +02:00
parent 93217958fb
commit cffde41f80
9 changed files with 25 additions and 29 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 185 KiB

View File

@ -43,8 +43,8 @@ MTS_NAMESPACE_BEGIN
* }
*
* \renderings{
* \rendering{$\sigma_s=2$, $\sigma_a=0.1$, thickness$=0.1$}{bsdf_hk_1}
* \rendering{\code{ketchup} material preset}{bsdf_hk_2}
* \rendering{An index-matched scattering layer with parameters $\sigma_s=2$, $\sigma_a=0.1$, thickness$=0.1$}{bsdf_hk_1}
* \rendering{Example of the HK model with a dielectric coating (and the \code{ketchup} material preset, see \lstref{hk-coated})}{bsdf_hk_2}
* }
*
* This plugin provides an implementation of the Hanrahan-Krueger BSDF
@ -60,8 +60,8 @@ MTS_NAMESPACE_BEGIN
* \begin{xml}
* <bsdf type="hk">
* <spectrum name="sigmaS" value="2"/>
* <spectrum name="sigmaA" value="0.05"/>
* <float name="thickness" value="1"/>
* <spectrum name="sigmaA" value="0.1"/>
* <float name="thickness" value="0.1"/>
*
* <phase type="hg">
* <float name="g" value="0.8"/>
@ -74,19 +74,14 @@ MTS_NAMESPACE_BEGIN
* of refraction are mismatched. The combination of these two plugins
* reproduces the full model proposed in \cite{Hanrahan1993Reflection}.
*
* \begin{xml}
* \begin{xml}[caption=A thin dielectric layer with measured ketchup scattering parameters, label=lst:hk-coated]
* <bsdf type="coating">
* <float name="extIOR" value="1.0"/>
* <float name="intIOR" value="1.5"/>
*
* <bsdf type="hk">
* <spectrum name="sigmaS" value="2"/>
* <spectrum name="sigmaA" value="0.05"/>
* <float name="thickness" value="1"/>
*
* <phase type="hg">
* <float name="g" value="0.8"/>
* </phase>
* <string name="material" value="ketchup"/>
* <float name="thickness" value="0.01"/>
* </bsdf>
* </bsdf>
* \end{xml}

View File

@ -275,8 +275,6 @@ public:
}
MTS_DECLARE_CLASS()
private:
bool m_strictNormals;
};
MTS_IMPLEMENT_CLASS_S(SimpleVolumetricPathTracer, false, MonteCarloIntegrator)

View File

@ -54,6 +54,7 @@ void Medium::configure() {
if (m_phaseFunction == NULL) {
m_phaseFunction = static_cast<PhaseFunction *> (PluginManager::getInstance()->
createObject(MTS_CLASS(PhaseFunction), Properties("isotropic")));
m_phaseFunction->configure();
}
}

View File

@ -27,7 +27,7 @@ Float PhaseFunction::sigmaDir(Float cosTheta) const {
" an anisotropic medium)");
return 0.0f;
}
Float PhaseFunction::sigmaDirMax() const {
Log(EError, "sigmaDirMax(): Not implemented! (this is not"
" an anisotropic medium)");

View File

@ -110,7 +110,7 @@ public:
}
void configure() {
int mipMapLevel = std::min(3, m_mipmap->getLevels()-1);
int mipMapLevel = std::min(0, m_mipmap->getLevels()-1);
m_pdfResolution = m_mipmap->getLevelResolution(mipMapLevel);
m_pdfInvResolution = Vector2(1.0f / m_pdfResolution.x,
1.0f / m_pdfResolution.y);

View File

@ -57,7 +57,7 @@ MTS_NAMESPACE_BEGIN
* \parameter{resolution}{\Integer}{Specifies the resolution of the precomputed
* image that is used to represent the sky environment map
* \default{256}}
* \parameter{intensityScale}{\Float}{
* \parameter{skyScale}{\Float}{
* This parameter can be used to scale the the amount of illumination
* emitted by the sky luminaire, for instance to change its units. To
* switch from photometric ($\nicefrac{W}{m^2\cdot sr}$)
@ -164,7 +164,7 @@ class SkyLuminaire : public Luminaire {
public:
SkyLuminaire(const Properties &props)
: Luminaire(props) {
m_intensityScale = props.getFloat("intensityScale", 1.0f);
m_scale = props.getFloat("skyScale", 1.0f);
m_turbidity = props.getFloat("turbidity", 3.0f);
if (m_turbidity < 1 || m_turbidity > 30)
Log(EError, "The turbidity parameter must be in the range [1,30]!");
@ -182,7 +182,7 @@ public:
SkyLuminaire(Stream *stream, InstanceManager *manager)
: Luminaire(stream, manager) {
m_intensityScale = stream->readFloat();
m_scale = stream->readFloat();
m_turbidity = stream->readFloat();
m_thetaS = stream->readFloat();
m_phiS = stream->readFloat();
@ -194,7 +194,7 @@ public:
void serialize(Stream *stream, InstanceManager *manager) const {
Luminaire::serialize(stream, manager);
stream->writeFloat(m_intensityScale);
stream->writeFloat(m_scale);
stream->writeFloat(m_turbidity);
stream->writeFloat(m_thetaS);
stream->writeFloat(m_phiS);
@ -265,7 +265,7 @@ public:
Float theta = (i+.5f)*factor.x;
for (int j=0; j<phiBins; ++j) {
Float phi = (j+.5f)*factor.y;
Spectrum s = getSkySpectralRadiance(theta, phi) * m_intensityScale;
Spectrum s = getSkySpectralRadiance(theta, phi) * m_scale;
Float r, g, b;
s.toLinearRGB(r, g, b);
*target++ = r; *target++ = g;
@ -290,7 +290,7 @@ public:
Spectrum Le(const Ray &ray) const {
Point2 coords = fromSphere(ray.d);
return getSkySpectralRadiance(coords.x, coords.y) * m_intensityScale;
return getSkySpectralRadiance(coords.x, coords.y) * m_scale;
}
std::string toString() const {
@ -299,7 +299,7 @@ public:
<< " turbidity = " << m_turbidity << "," << endl
<< " sunPos = [theta: " << m_thetaS << ", phi: "<< m_phiS << "]," << endl
<< " zenithL = " << m_zenithL << "," << endl
<< " intensityScale = " << m_intensityScale << endl
<< " skyScale = " << m_scale << endl
<< "]";
return oss.str();
}
@ -385,7 +385,7 @@ protected:
/* Environment map resolution */
int m_resolution;
/* Constant scale factor applied to the model */
Float m_intensityScale;
Float m_scale;
/* The turbidity of the sky ranges normally from 1 to 30.
For clear skies values in range [2,6] are useful. */
Float m_turbidity;

View File

@ -58,12 +58,13 @@ MTS_NAMESPACE_BEGIN
* \parameter{resolution}{\Integer}{Specifies the resolution of the precomputed
* image that is used to represent the sky environment map
* \default{256}}
* \parameter{scale}{\Float}{
* \parameter{skyScale}{\Float}{
* This parameter can be used to scale the the amount of illumination
* emitted by the sky luminaire, for instance to change its units. To
* switch from photometric ($\nicefrac{W}{m^2\cdot sr}$)
* to arbitrary but convenient units in the $[0,1]$ range, set
* this parameter to \code{1e-5}.\default{1}.
* emitted by the sky.
* }
* \parameter{sunScale}{\Float}{
* This parameter can be used to scale the the amount of illumination
* emitted by the sun.
* }
* }
*

View File

@ -86,6 +86,7 @@ public:
HeterogeneousMedium(const Properties &props)
: Medium(props) {
m_stepSize = props.getFloat("stepSize", 0);
m_densityMultiplier = props.getFloat("densityMultiplier", 1);
if (props.hasProperty("sigmaS") || props.hasProperty("sigmaA"))
Log(EError, "The 'sigmaS' and 'sigmaA' properties are only supported by "
"homogeneous media. Please use nested volume instances to supply "