diff --git a/src/bsdfs/mask.cpp b/src/bsdfs/mask.cpp index 4c1bf3d8..d676e0d0 100644 --- a/src/bsdfs/mask.cpp +++ b/src/bsdfs/mask.cpp @@ -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(child); diff --git a/src/bsdfs/mixturebsdf.cpp b/src/bsdfs/mixturebsdf.cpp index c0453daa..51fc444e 100644 --- a/src/bsdfs/mixturebsdf.cpp +++ b/src/bsdfs/mixturebsdf.cpp @@ -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 m_bsdfShader;