implemented getRoughness() for the remainder of BSDFs
parent
cf5bf411e4
commit
aec0c6a984
|
@ -261,6 +261,12 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Float getRoughness(const Intersection &its, int component) const {
|
||||||
|
int bsdfIndex = m_indices[component].first;
|
||||||
|
component = m_indices[component].second;
|
||||||
|
return m_bsdfs[bsdfIndex]->getRoughness(its, component);
|
||||||
|
}
|
||||||
|
|
||||||
void addChild(const std::string &name, ConfigurableObject *child) {
|
void addChild(const std::string &name, ConfigurableObject *child) {
|
||||||
if (child->getClass()->derivesFrom(MTS_CLASS(BSDF))) {
|
if (child->getClass()->derivesFrom(MTS_CLASS(BSDF))) {
|
||||||
BSDF *bsdf = static_cast<BSDF *>(child);
|
BSDF *bsdf = static_cast<BSDF *>(child);
|
||||||
|
|
|
@ -230,6 +230,10 @@ public:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Float getRoughness(const Intersection &its, int component) const {
|
||||||
|
return m_nested->getRoughness(its, component);
|
||||||
|
}
|
||||||
|
|
||||||
std::string toString() const {
|
std::string toString() const {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "BumpMap[" << endl
|
oss << "BumpMap[" << endl
|
||||||
|
|
|
@ -379,6 +379,11 @@ public:
|
||||||
return SmoothCoating::sample(bRec, pdf, sample);
|
return SmoothCoating::sample(bRec, pdf, sample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Float getRoughness(const Intersection &its, int component) const {
|
||||||
|
return component < (int) m_components.size()
|
||||||
|
? m_nested->getRoughness(its, component) : (Float) 0;
|
||||||
|
}
|
||||||
|
|
||||||
std::string toString() const {
|
std::string toString() const {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "SmoothCoating[" << endl
|
oss << "SmoothCoating[" << endl
|
||||||
|
|
|
@ -408,6 +408,12 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Float getRoughness(const Intersection &its, int component) const {
|
||||||
|
/* For lack of a better value, treat this material as diffuse
|
||||||
|
in Manifold Exploration */
|
||||||
|
return std::numeric_limits<Float>::infinity();
|
||||||
|
}
|
||||||
|
|
||||||
std::string toString() const {
|
std::string toString() const {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "HanrahanKrueger[" << endl
|
oss << "HanrahanKrueger[" << endl
|
||||||
|
|
|
@ -614,6 +614,12 @@ public:
|
||||||
return al / (4.0f * M_PI) * c1 * c2 / (c1 + c2);
|
return al / (4.0f * M_PI) * c1 * c2 / (c1 + c2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Float getRoughness(const Intersection &its, int component) const {
|
||||||
|
/* For lack of a better value, treat this material as diffuse
|
||||||
|
in Manifold Exploration */
|
||||||
|
return std::numeric_limits<Float>::infinity();
|
||||||
|
}
|
||||||
|
|
||||||
std::string toString() const {
|
std::string toString() const {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "IrawanClothBRDF[" << endl
|
oss << "IrawanClothBRDF[" << endl
|
||||||
|
|
|
@ -437,6 +437,12 @@ public:
|
||||||
return RoughCoating::sample(bRec, pdf, sample);
|
return RoughCoating::sample(bRec, pdf, sample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Float getRoughness(const Intersection &its, int component) const {
|
||||||
|
return component < (int) m_components.size()
|
||||||
|
? m_nested->getRoughness(its, component)
|
||||||
|
: m_alpha->getAverage().average();
|
||||||
|
}
|
||||||
|
|
||||||
void addChild(const std::string &name, ConfigurableObject *child) {
|
void addChild(const std::string &name, ConfigurableObject *child) {
|
||||||
if (child->getClass()->derivesFrom(MTS_CLASS(BSDF))) {
|
if (child->getClass()->derivesFrom(MTS_CLASS(BSDF))) {
|
||||||
if (m_nested != NULL)
|
if (m_nested != NULL)
|
||||||
|
|
Loading…
Reference in New Issue