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
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-11-18 16:58:33 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2014-11-18 17:05:15 +0300
commit729dc98be167a77e418489d19042168863085845 (patch)
tree5b0ed62bb0bbb6559f9fd2626d22e1c64146f6d4 /intern/cycles
parentc07241dd186bdf197ade384aa35d23111b1af94b (diff)
Fix T42475: Vector motion blur on hair
Issue was caused by mismatch in pre/post transform matrix spaces for mesh and curve vectors. This happened because of current way how static transform apply works: it only stores post/pre in the world space if there's triangle motion exists. This lead to situation when there's no triangle motion happening but was hair motion happening. After long time of trying to solve it in a nice way, ended up solving it in a bit slow way -- pre/post transform is still storing in the same spaces as they used to be stored and just convert hair pre/post position to a world space in the kernel. This is because currently it's not so clear how to deal with cases when curve and mesh motion needs different space of pre/post transform (which happens in cases when only one of the motions exists). Would think of some magic, and meanwhile artists could be happy with proper render results.
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/kernel/geom/geom_primitive.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/kernel/geom/geom_primitive.h b/intern/cycles/kernel/geom/geom_primitive.h
index 5df6c75df86..707977750bc 100644
--- a/intern/cycles/kernel/geom/geom_primitive.h
+++ b/intern/cycles/kernel/geom/geom_primitive.h
@@ -144,7 +144,8 @@ ccl_device float4 primitive_motion_vector(KernelGlobals *kg, ShaderData *sd)
float3 center;
#ifdef __HAIR__
- if(sd->type & PRIMITIVE_ALL_CURVE) {
+ bool is_curve_primitive = sd->type & PRIMITIVE_ALL_CURVE;
+ if(is_curve_primitive) {
center = curve_motion_center_location(kg, sd);
if(!(sd->flag & SD_TRANSFORM_APPLIED))
@@ -170,6 +171,13 @@ ccl_device float4 primitive_motion_vector(KernelGlobals *kg, ShaderData *sd)
motion_pre = primitive_attribute_float3(kg, sd, elem, offset, NULL, NULL);
motion_post = primitive_attribute_float3(kg, sd, elem, offset_next, NULL, NULL);
+
+#ifdef __HAIR__
+ if(is_curve_primitive) {
+ object_position_transform(kg, sd, &motion_pre);
+ object_position_transform(kg, sd, &motion_post);
+ }
+#endif
}
/* object motion. note that depending on the mesh having motion vectors, this