Cycles: Enable SSS from Principled BSDF only when actually in use
This gives speed up for the split kernel in scenes using the principled BSDF but without subsurface scattering.
This commit is contained in:
@@ -2337,6 +2337,12 @@ PrincipledBsdfNode::PrincipledBsdfNode()
|
|||||||
distribution_orig = NBUILTIN_CLOSURES;
|
distribution_orig = NBUILTIN_CLOSURES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PrincipledBsdfNode::has_surface_bssrdf()
|
||||||
|
{
|
||||||
|
ShaderInput *subsurface_in = input("Subsurface");
|
||||||
|
return (subsurface_in->link != NULL || subsurface > CLOSURE_WEIGHT_CUTOFF);
|
||||||
|
}
|
||||||
|
|
||||||
void PrincipledBsdfNode::attributes(Shader *shader, AttributeRequestSet *attributes)
|
void PrincipledBsdfNode::attributes(Shader *shader, AttributeRequestSet *attributes)
|
||||||
{
|
{
|
||||||
if(shader->has_surface) {
|
if(shader->has_surface) {
|
||||||
|
@@ -374,7 +374,7 @@ public:
|
|||||||
SHADER_NODE_CLASS(PrincipledBsdfNode)
|
SHADER_NODE_CLASS(PrincipledBsdfNode)
|
||||||
|
|
||||||
bool has_spatial_varying() { return true; }
|
bool has_spatial_varying() { return true; }
|
||||||
bool has_surface_bssrdf() { return true; }
|
bool has_surface_bssrdf();
|
||||||
bool has_bssrdf_bump();
|
bool has_bssrdf_bump();
|
||||||
void compile(SVMCompiler& compiler, ShaderInput *metallic, ShaderInput *subsurface, ShaderInput *subsurface_radius,
|
void compile(SVMCompiler& compiler, ShaderInput *metallic, ShaderInput *subsurface, ShaderInput *subsurface_radius,
|
||||||
ShaderInput *specular, ShaderInput *roughness, ShaderInput *specular_tint, ShaderInput *anisotropic,
|
ShaderInput *specular, ShaderInput *roughness, ShaderInput *specular_tint, ShaderInput *anisotropic,
|
||||||
|
Reference in New Issue
Block a user