Cycles: De-duplicate utility functions in ccl::Graph

This commit is contained in:
Sergey Sharybin
2015-12-15 20:04:00 +05:00
parent 669fdca681
commit baaf10cb26
3 changed files with 10 additions and 36 deletions

View File

@@ -1891,7 +1891,7 @@ void GlossyBsdfNode::simplify_settings(Scene *scene)
/* Fallback to Sharp closure for Roughness close to 0.
* Note: Keep the epsilon in sync with kernel!
*/
ShaderInput *roughness_input = get_input("Roughness");
ShaderInput *roughness_input = input("Roughness");
if(!roughness_input->link && roughness_input->value.x <= 1e-4f) {
distribution = ustring("Sharp");
}
@@ -1905,7 +1905,7 @@ void GlossyBsdfNode::simplify_settings(Scene *scene)
bool GlossyBsdfNode::has_integrator_dependency()
{
ShaderInput *roughness_input = get_input("Roughness");
ShaderInput *roughness_input = input("Roughness");
return !roughness_input->link && roughness_input->value.x <= 1e-4f;
}
@@ -1960,7 +1960,7 @@ void GlassBsdfNode::simplify_settings(Scene *scene)
/* Fallback to Sharp closure for Roughness close to 0.
* Note: Keep the epsilon in sync with kernel!
*/
ShaderInput *roughness_input = get_input("Roughness");
ShaderInput *roughness_input = input("Roughness");
if(!roughness_input->link && roughness_input->value.x <= 1e-4f) {
distribution = ustring("Sharp");
}
@@ -1974,7 +1974,7 @@ void GlassBsdfNode::simplify_settings(Scene *scene)
bool GlassBsdfNode::has_integrator_dependency()
{
ShaderInput *roughness_input = get_input("Roughness");
ShaderInput *roughness_input = input("Roughness");
return !roughness_input->link && roughness_input->value.x <= 1e-4f;
}
@@ -2029,7 +2029,7 @@ void RefractionBsdfNode::simplify_settings(Scene *scene)
/* Fallback to Sharp closure for Roughness close to 0.
* Note: Keep the epsilon in sync with kernel!
*/
ShaderInput *roughness_input = get_input("Roughness");
ShaderInput *roughness_input = input("Roughness");
if(!roughness_input->link && roughness_input->value.x <= 1e-4f) {
distribution = ustring("Sharp");
}
@@ -2043,7 +2043,7 @@ void RefractionBsdfNode::simplify_settings(Scene *scene)
bool RefractionBsdfNode::has_integrator_dependency()
{
ShaderInput *roughness_input = get_input("Roughness");
ShaderInput *roughness_input = input("Roughness");
return !roughness_input->link && roughness_input->value.x <= 1e-4f;
}