added a 'none' conductor profile which has 100% reflectance regardless of the angle of incidence
parent
4a86baac4e
commit
eb416b6c1c
|
@ -19,6 +19,7 @@
|
||||||
#include <mitsuba/render/bsdf.h>
|
#include <mitsuba/render/bsdf.h>
|
||||||
#include <mitsuba/core/fresolver.h>
|
#include <mitsuba/core/fresolver.h>
|
||||||
#include <mitsuba/hw/basicshader.h>
|
#include <mitsuba/hw/basicshader.h>
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
MTS_NAMESPACE_BEGIN
|
MTS_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
@ -70,6 +71,9 @@ MTS_NAMESPACE_BEGIN
|
||||||
* coatings, which are not actually conductors. These materials can also
|
* coatings, which are not actually conductors. These materials can also
|
||||||
* be used with this plugin, though note that the plugin will ignore any
|
* be used with this plugin, though note that the plugin will ignore any
|
||||||
* refraction component that the actual material might have had.
|
* refraction component that the actual material might have had.
|
||||||
|
* There is also a special material profile named \code{none}, which disables
|
||||||
|
* the computation of Fresnel reflectances and produces an idealized
|
||||||
|
* 100% reflecting mirror.
|
||||||
*
|
*
|
||||||
* When using this plugin, you should ideally compile Mitsuba with support for
|
* When using this plugin, you should ideally compile Mitsuba with support for
|
||||||
* spectral rendering to get the most accurate results. While it also works
|
* spectral rendering to get the most accurate results. While it also works
|
||||||
|
@ -127,7 +131,7 @@ MTS_NAMESPACE_BEGIN
|
||||||
* K, K\_palik & Polycrystalline potassium && W & Tungsten \\
|
* K, K\_palik & Polycrystalline potassium && W & Tungsten \\
|
||||||
* Li, Li\_palik & Lithium && \\
|
* Li, Li\_palik & Lithium && \\
|
||||||
* MgO, MgO\_palik & Magnesium oxide && \\
|
* MgO, MgO\_palik & Magnesium oxide && \\
|
||||||
* Mo, Mo\_palik & Molybdenum && \\
|
* Mo, Mo\_palik & Molybdenum && none & No mat. profile ($\to$ 100% reflecting mirror)\\
|
||||||
* \bottomrule
|
* \bottomrule
|
||||||
* \end{tabular}
|
* \end{tabular}
|
||||||
* \caption{
|
* \caption{
|
||||||
|
@ -151,11 +155,17 @@ public:
|
||||||
props.getSpectrum("specularReflectance", Spectrum(1.0f)));
|
props.getSpectrum("specularReflectance", Spectrum(1.0f)));
|
||||||
|
|
||||||
std::string material = props.getString("material", "Cu");
|
std::string material = props.getString("material", "Cu");
|
||||||
|
|
||||||
Spectrum materialEta, materialK;
|
Spectrum materialEta, materialK;
|
||||||
materialEta.fromContinuousSpectrum(InterpolatedSpectrum(
|
if (boost::to_lower_copy(material) == "none") {
|
||||||
fResolver->resolve("data/ior/" + material + ".eta.spd")));
|
materialEta = Spectrum(0.0f);
|
||||||
materialK.fromContinuousSpectrum(InterpolatedSpectrum(
|
materialK = Spectrum(1.0f);
|
||||||
fResolver->resolve("data/ior/" + material + ".k.spd")));
|
} else {
|
||||||
|
materialEta.fromContinuousSpectrum(InterpolatedSpectrum(
|
||||||
|
fResolver->resolve("data/ior/" + material + ".eta.spd")));
|
||||||
|
materialK.fromContinuousSpectrum(InterpolatedSpectrum(
|
||||||
|
fResolver->resolve("data/ior/" + material + ".k.spd")));
|
||||||
|
}
|
||||||
|
|
||||||
m_eta = props.getSpectrum("eta", materialEta);
|
m_eta = props.getSpectrum("eta", materialEta);
|
||||||
m_k = props.getSpectrum("k", materialK);
|
m_k = props.getSpectrum("k", materialK);
|
||||||
|
|
|
@ -102,6 +102,9 @@ MTS_NAMESPACE_BEGIN
|
||||||
* refraction information, this plugin can access a set of measured materials
|
* refraction information, this plugin can access a set of measured materials
|
||||||
* for which visible-spectrum information was publicly available
|
* for which visible-spectrum information was publicly available
|
||||||
* (see \tblref{conductor-iors} for the full list).
|
* (see \tblref{conductor-iors} for the full list).
|
||||||
|
* There is also a special material profile named \code{none}, which disables
|
||||||
|
* the computation of Fresnel reflectances and produces an idealized
|
||||||
|
* 100% reflecting mirror.
|
||||||
*
|
*
|
||||||
* When no parameters are given, the plugin activates the default settings,
|
* When no parameters are given, the plugin activates the default settings,
|
||||||
* which describe copper with a light amount of roughness modeled using a
|
* which describe copper with a light amount of roughness modeled using a
|
||||||
|
@ -157,10 +160,16 @@ public:
|
||||||
|
|
||||||
std::string material = props.getString("material", "Cu");
|
std::string material = props.getString("material", "Cu");
|
||||||
Spectrum materialEta, materialK;
|
Spectrum materialEta, materialK;
|
||||||
materialEta.fromContinuousSpectrum(InterpolatedSpectrum(
|
|
||||||
fResolver->resolve("data/ior/" + material + ".eta.spd")));
|
if (boost::to_lower_copy(material) == "none") {
|
||||||
materialK.fromContinuousSpectrum(InterpolatedSpectrum(
|
materialEta = Spectrum(0.0f);
|
||||||
fResolver->resolve("data/ior/" + material + ".k.spd")));
|
materialK = Spectrum(1.0f);
|
||||||
|
} else {
|
||||||
|
materialEta.fromContinuousSpectrum(InterpolatedSpectrum(
|
||||||
|
fResolver->resolve("data/ior/" + material + ".eta.spd")));
|
||||||
|
materialK.fromContinuousSpectrum(InterpolatedSpectrum(
|
||||||
|
fResolver->resolve("data/ior/" + material + ".k.spd")));
|
||||||
|
}
|
||||||
|
|
||||||
m_eta = props.getSpectrum("eta", materialEta);
|
m_eta = props.getSpectrum("eta", materialEta);
|
||||||
m_k = props.getSpectrum("k", materialK);
|
m_k = props.getSpectrum("k", materialK);
|
||||||
|
|
Loading…
Reference in New Issue