Merge branch 'blender-v4.0-release' into main

This commit is contained in:
Brecht Van Lommel 2023-10-18 17:24:14 +02:00
commit 5eb05c2a68
1 changed files with 9 additions and 0 deletions

View File

@ -349,13 +349,22 @@ void Shader::tag_update(Scene *scene)
has_displacement = has_displacement || output->input("Displacement")->link;
if (!has_surface) {
/* If we need to output surface AOVs, add a Transparent BSDF so that the
* surface shader runs. */
foreach (ShaderNode *node, graph->nodes) {
if (node->special_type == SHADER_SPECIAL_TYPE_OUTPUT_AOV) {
foreach (const ShaderInput *in, node->inputs) {
if (in->link) {
TransparentBsdfNode *transparent = graph->create_node<TransparentBsdfNode>();
graph->add(transparent);
graph->connect(transparent->output("BSDF"), output->input("Surface"));
has_surface = true;
break;
}
}
if (has_surface) {
break;
}
}
}
}