From cefd6140f322250d630f4d845fe5bdb013c00ddc Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 1 Aug 2022 16:07:10 +0200 Subject: [PATCH 1/2] Fix T100119: Cycles light object's parametric vector distorted Caused by 38af5b050100. Adjust barycentric coordinates used for intersection result in the ray-to-rectangle intersection check. Differential Revision: https://developer.blender.org/D15592 --- intern/cycles/util/math_intersect.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/intern/cycles/util/math_intersect.h b/intern/cycles/util/math_intersect.h index 37bdc5f1ccf..cc07cbe7745 100644 --- a/intern/cycles/util/math_intersect.h +++ b/intern/cycles/util/math_intersect.h @@ -209,10 +209,13 @@ ccl_device bool ray_quad_intersect(float3 ray_P, *isect_P = hit; if (isect_t != NULL) *isect_t = t; + + /* NOTE: Return barycentric coordinates in the same notation as Embree and OptiX. */ if (isect_u != NULL) - *isect_u = u + 0.5f; + *isect_u = v + 0.5f; if (isect_v != NULL) - *isect_v = v + 0.5f; + *isect_v = -u - v; + return true; } From 96447402309ae79bdca92a0c40c49a4861596081 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 9 Aug 2022 16:44:36 +0200 Subject: [PATCH 2/2] Fix T99949: Crash when last input from File Output node is deleted Regression since e4278b72bb1a. Need to check inputs exist prior to requesting first input as it might not exist. --- source/blender/compositor/nodes/COM_OutputFileNode.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.cc b/source/blender/compositor/nodes/COM_OutputFileNode.cc index f69511d88e6..a62d21bb657 100644 --- a/source/blender/compositor/nodes/COM_OutputFileNode.cc +++ b/source/blender/compositor/nodes/COM_OutputFileNode.cc @@ -37,6 +37,10 @@ void OutputFileNode::map_input_sockets(NodeConverter &converter, void OutputFileNode::add_preview_to_first_linked_input(NodeConverter &converter) const { + if (get_input_sockets().is_empty()) { + return; + } + NodeInput *first_socket = this->get_input_socket(0); if (first_socket->is_linked()) { converter.add_node_input_preview(first_socket);