forked from bartvdbraak/blender
Cycles: Missed some changes in the previous hair motion blur fix
So now cases when object has both hair motion blur and deformation motion blur vector pass is all correct. We could get rid of the flag in the future, still need to look deeper into all the areas trying to find a more clear solution.
This commit is contained in:
parent
2b2ac5d3cc
commit
d06b1a5d8b
@ -173,7 +173,7 @@ ccl_device float4 primitive_motion_vector(KernelGlobals *kg, ShaderData *sd)
|
|||||||
motion_post = primitive_attribute_float3(kg, sd, elem, offset_next, NULL, NULL);
|
motion_post = primitive_attribute_float3(kg, sd, elem, offset_next, NULL, NULL);
|
||||||
|
|
||||||
#ifdef __HAIR__
|
#ifdef __HAIR__
|
||||||
if(is_curve_primitive) {
|
if(is_curve_primitive && (sd->flag & SD_OBJECT_HAS_VERTEX_MOTION) == 0) {
|
||||||
object_position_transform(kg, sd, &motion_pre);
|
object_position_transform(kg, sd, &motion_pre);
|
||||||
object_position_transform(kg, sd, &motion_post);
|
object_position_transform(kg, sd, &motion_post);
|
||||||
}
|
}
|
||||||
|
@ -631,6 +631,7 @@ enum ShaderDataFlag {
|
|||||||
SD_NEGATIVE_SCALE_APPLIED = (1 << 24), /* vertices have negative scale applied */
|
SD_NEGATIVE_SCALE_APPLIED = (1 << 24), /* vertices have negative scale applied */
|
||||||
SD_OBJECT_HAS_VOLUME = (1 << 25), /* object has a volume shader */
|
SD_OBJECT_HAS_VOLUME = (1 << 25), /* object has a volume shader */
|
||||||
SD_OBJECT_INTERSECTS_VOLUME = (1 << 26), /* object intersects AABB of an object with volume shader */
|
SD_OBJECT_INTERSECTS_VOLUME = (1 << 26), /* object intersects AABB of an object with volume shader */
|
||||||
|
SD_OBJECT_HAS_VERTEX_MOTION = (1 << 22), /* has position for motion vertices */
|
||||||
|
|
||||||
SD_OBJECT_FLAGS = (SD_HOLDOUT_MASK|SD_OBJECT_MOTION|SD_TRANSFORM_APPLIED|
|
SD_OBJECT_FLAGS = (SD_HOLDOUT_MASK|SD_OBJECT_MOTION|SD_TRANSFORM_APPLIED|
|
||||||
SD_NEGATIVE_SCALE_APPLIED|SD_OBJECT_HAS_VOLUME|
|
SD_NEGATIVE_SCALE_APPLIED|SD_OBJECT_HAS_VOLUME|
|
||||||
|
@ -318,6 +318,9 @@ void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene
|
|||||||
mtfm_pre = mtfm_pre * itfm;
|
mtfm_pre = mtfm_pre * itfm;
|
||||||
mtfm_post = mtfm_post * itfm;
|
mtfm_post = mtfm_post * itfm;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
flag |= SD_OBJECT_HAS_VERTEX_MOTION;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(&objects_vector[i*OBJECT_VECTOR_SIZE+0], &mtfm_pre, sizeof(float4)*3);
|
memcpy(&objects_vector[i*OBJECT_VECTOR_SIZE+0], &mtfm_pre, sizeof(float4)*3);
|
||||||
memcpy(&objects_vector[i*OBJECT_VECTOR_SIZE+3], &mtfm_post, sizeof(float4)*3);
|
memcpy(&objects_vector[i*OBJECT_VECTOR_SIZE+3], &mtfm_post, sizeof(float4)*3);
|
||||||
|
Loading…
Reference in New Issue
Block a user