Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2020-02-24 22:29:01 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2020-02-24 22:29:36 +0300
commitf61f26b033fd7d9c8b8bbf8b77cb24ef902f5ba8 (patch)
treea420cc525445080707833deeecbd8eafa69743b0 /intern
parentd109ea5ee50f79ca9e008c7d3d4707792b9d9c36 (diff)
Fix Cycles Embree hair + motion blur failing after recent Catmull-Rom change
Ref T73778
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/bvh/bvh_embree.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/intern/cycles/bvh/bvh_embree.cpp b/intern/cycles/bvh/bvh_embree.cpp
index f621c5c0dd4..639dfe3cee2 100644
--- a/intern/cycles/bvh/bvh_embree.cpp
+++ b/intern/cycles/bvh/bvh_embree.cpp
@@ -728,8 +728,9 @@ void BVHEmbree::update_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair
}
/* Catmull-Rom splines need extra CVs at the beginning and end of each curve. */
+ size_t num_keys_embree = num_keys;
if (use_curves) {
- num_keys += num_curves * 2;
+ num_keys_embree += num_curves * 2;
}
/* Copy the CV data to Embree */
@@ -746,7 +747,7 @@ void BVHEmbree::update_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair
}
float4 *rtc_verts = (float4 *)rtcSetNewGeometryBuffer(
- geom_id, RTC_BUFFER_TYPE_VERTEX, t, RTC_FORMAT_FLOAT4, sizeof(float) * 4, num_keys);
+ geom_id, RTC_BUFFER_TYPE_VERTEX, t, RTC_FORMAT_FLOAT4, sizeof(float) * 4, num_keys_embree);
assert(rtc_verts);
if (rtc_verts) {
@@ -767,7 +768,7 @@ void BVHEmbree::update_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair
}
}
else {
- for (size_t j = 0; j < num_keys; ++j) {
+ for (size_t j = 0; j < num_keys_embree; ++j) {
rtc_verts[j] = float3_to_float4(verts[j]);
rtc_verts[j].w = curve_radius[j];
}