implemented getRoughness() for a few more BSDFs

metadata
Wenzel Jakob 2012-10-12 00:25:11 -04:00
parent d5b944d6a3
commit cf5bf411e4
2 changed files with 10 additions and 1 deletions

View File

@ -218,6 +218,10 @@ public:
return result;
}
Float getRoughness(const Intersection &its, int component) const {
return m_nestedBSDF->getRoughness(its, component);
}
void addChild(const std::string &name, ConfigurableObject *child) {
if (child->getClass()->derivesFrom(MTS_CLASS(Texture)) && name == "opacity")
m_opacity = static_cast<Texture *>(child);

View File

@ -285,6 +285,12 @@ public:
BSDF::addChild(name, child);
}
}
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);
}
std::string toString() const {
std::ostringstream oss;
@ -418,7 +424,6 @@ public:
}
}
MTS_DECLARE_CLASS()
private:
std::vector<Shader *> m_bsdfShader;