diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/render/nodes.cpp | 13 | ||||
-rw-r--r-- | intern/cycles/render/volume.cpp | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index bde573bf0dc..b59dd124040 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -2791,7 +2791,7 @@ void PrincipledBsdfNode::expand(ShaderGraph *graph) ShaderInput *emission_strength_in = input("Emission Strength"); if ((emission_in->link || emission != make_float3(0.0f, 0.0f, 0.0f)) && (emission_strength_in->link || emission_strength != 0.0f)) { - /* Create add closure and emission. */ + /* Create add closure and emission, and relink inputs. */ AddClosureNode *add = graph->create_node<AddClosureNode>(); EmissionNode *emission_node = graph->create_node<EmissionNode>(); ShaderOutput *new_out = add->output("Closure"); @@ -2807,6 +2807,16 @@ void PrincipledBsdfNode::expand(ShaderGraph *graph) principled_out = new_out; } + else { + /* Disconnect unused links if the other value is zero, required before + * we remove the input from the node entirely. */ + if (emission_in->link) { + emission_in->disconnect(); + } + if (emission_strength_in->link) { + emission_strength_in->disconnect(); + } + } ShaderInput *alpha_in = input("Alpha"); if (alpha_in->link || alpha != 1.0f) { @@ -2824,6 +2834,7 @@ void PrincipledBsdfNode::expand(ShaderGraph *graph) } remove_input(emission_in); + remove_input(emission_strength_in); remove_input(alpha_in); } diff --git a/intern/cycles/render/volume.cpp b/intern/cycles/render/volume.cpp index 64196cdd8a8..85624d9af65 100644 --- a/intern/cycles/render/volume.cpp +++ b/intern/cycles/render/volume.cpp @@ -285,6 +285,10 @@ void VolumeMeshBuilder::create_mesh(vector<float3> &vertices, vector<int3> vertices_is; vector<QuadData> quads; + /* make sure we only have leaf nodes in the tree, as tiles are not handled by + * this algorithm */ + topology_grid->tree().voxelizeActiveTiles(); + generate_vertices_and_quads(vertices_is, quads); convert_object_space(vertices_is, vertices, face_overlap_avoidance); |