2011-02-03 16:15:25 +08:00
|
|
|
#include <mitsuba/render/phase.h>
|
|
|
|
#include <mitsuba/render/medium.h>
|
|
|
|
|
|
|
|
MTS_NAMESPACE_BEGIN
|
|
|
|
|
2012-09-28 00:43:51 +08:00
|
|
|
std::string PhaseFunctionSamplingRecord::toString() const {
|
2011-02-03 16:15:25 +08:00
|
|
|
std::ostringstream oss;
|
2012-09-28 00:43:51 +08:00
|
|
|
oss << "PhaseFunctionSamplingRecord[" << endl
|
|
|
|
<< " mRec = " << indent(mRec.toString()) << "," << endl
|
|
|
|
<< " wi = " << wi.toString() << "," << endl
|
|
|
|
<< " wo = " << wo.toString() << "," << endl
|
|
|
|
<< " mode = " << mode << endl
|
2011-02-03 16:15:25 +08:00
|
|
|
<< "]";
|
|
|
|
return oss.str();
|
|
|
|
}
|
|
|
|
|
2012-09-28 00:43:51 +08:00
|
|
|
void PhaseFunction::configure() {
|
|
|
|
m_type = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
Float PhaseFunction::pdf(const PhaseFunctionSamplingRecord &pRec) const {
|
2011-07-05 02:13:36 +08:00
|
|
|
return eval(pRec);
|
2011-02-03 16:15:25 +08:00
|
|
|
}
|
2011-04-14 21:15:59 +08:00
|
|
|
|
|
|
|
bool PhaseFunction::needsDirectionallyVaryingCoefficients() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-04-14 21:44:13 +08:00
|
|
|
Float PhaseFunction::sigmaDir(Float cosTheta) const {
|
2012-09-28 00:43:51 +08:00
|
|
|
Log(EError, "%s::sigmaDir(Float) is not implemented (this is not "
|
|
|
|
"an anisotropic medium!)", getClass()->getName().c_str());
|
2011-04-14 21:15:59 +08:00
|
|
|
return 0.0f;
|
|
|
|
}
|
2011-07-29 09:29:11 +08:00
|
|
|
|
2011-04-27 18:01:29 +08:00
|
|
|
Float PhaseFunction::sigmaDirMax() const {
|
2012-09-28 00:43:51 +08:00
|
|
|
Log(EError, "%s::sigmaDirMax() is not implemented (this is not "
|
|
|
|
"an anisotropic medium!)", getClass()->getName().c_str());
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
Float PhaseFunction::getMeanCosine() const {
|
|
|
|
Log(EError, "%s::getMeanCosine() is not implemented!",
|
|
|
|
getClass()->getName().c_str());
|
2011-04-27 18:01:29 +08:00
|
|
|
return 0.0f;
|
|
|
|
}
|
2011-02-03 16:15:25 +08:00
|
|
|
|
|
|
|
MTS_IMPLEMENT_CLASS(PhaseFunction, true, ConfigurableObject)
|
|
|
|
MTS_NAMESPACE_END
|