had forgotten about the phong model, other minor tweaks
parent
eb423bf9f9
commit
6aa7534d67
|
@ -263,6 +263,15 @@ public:
|
||||||
manager->serialize(stream, m_exponent.get());
|
manager->serialize(stream, m_exponent.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Float getRoughness(const Intersection &its, int component) const {
|
||||||
|
Assert(component == 0 || component == 1);
|
||||||
|
/* Find the Beckmann-equivalent roughness */
|
||||||
|
if (component == 0)
|
||||||
|
return std::sqrt(2 / (2+m_exponent->eval(its).average()));
|
||||||
|
else
|
||||||
|
return std::numeric_limits<Float>::infinity();
|
||||||
|
}
|
||||||
|
|
||||||
std::string toString() const {
|
std::string toString() const {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "Phong[" << endl
|
oss << "Phong[" << endl
|
||||||
|
|
|
@ -440,7 +440,7 @@ public:
|
||||||
Float getRoughness(const Intersection &its, int component) const {
|
Float getRoughness(const Intersection &its, int component) const {
|
||||||
return component < (int) m_components.size()
|
return component < (int) m_components.size()
|
||||||
? m_nested->getRoughness(its, component)
|
? m_nested->getRoughness(its, component)
|
||||||
: m_alpha->getAverage().average();
|
: m_alpha->eval(its).average();
|
||||||
}
|
}
|
||||||
|
|
||||||
void addChild(const std::string &name, ConfigurableObject *child) {
|
void addChild(const std::string &name, ConfigurableObject *child) {
|
||||||
|
|
|
@ -505,7 +505,7 @@ public:
|
||||||
Assert(component == 0 || component == 1);
|
Assert(component == 0 || component == 1);
|
||||||
|
|
||||||
if (component == 0)
|
if (component == 0)
|
||||||
return m_alpha->getAverage().average();
|
return m_alpha->eval(its).average();
|
||||||
else
|
else
|
||||||
return std::numeric_limits<Float>::infinity();
|
return std::numeric_limits<Float>::infinity();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue