Commit: 729dc98be167a77e418489d19042168863085845
Author: Sergey Sharybin
Date: Tue Nov 18 14:58:33 2014 +0100
Branches: master
https://developer.blender.org/rB729dc98be167a77e418489d19042168863085845
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.
===================================================================
M intern/cycles/kernel/geom/geom_primitive.h
===================================================================
diff --git a/intern/cycles/kernel/geom/geom_primitive.h
b/intern/cycles/kernel/geom/geom_primitive.h
index 5df6c75..7079777 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
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs