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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2014-03-29 16:03:46 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-03-29 16:03:46 +0400
commit99f59930885ed69890967f8864a3aa0626249d86 (patch)
treeb6f8dcc40c294077d585639e701f7fdf9b6c0dcb /intern/cycles/kernel/geom
parent934767cf7f51ae82224138de2ffcafe7bae2b8fa (diff)
Cycles code refactor: improve vertex motion attribute storage and export.
This now supports multiple steps and subframe sampling of motion. There is one difference for object and camera transform motion blur. It still only supports two steps there, but the transforms are now sampled at subframe times instead of the previous and next frame and then interpolated/extrapolated. This will give different render results in some cases but it's more accurate. Part of the code is from the summer of code project by Gavin Howard, but it has been significantly rewritten and extended.
Diffstat (limited to 'intern/cycles/kernel/geom')
-rw-r--r--intern/cycles/kernel/geom/geom_object.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/intern/cycles/kernel/geom/geom_object.h b/intern/cycles/kernel/geom/geom_object.h
index 3646615b9f6..b1106c25fd7 100644
--- a/intern/cycles/kernel/geom/geom_object.h
+++ b/intern/cycles/kernel/geom/geom_object.h
@@ -230,6 +230,21 @@ ccl_device_inline float3 object_dupli_uv(KernelGlobals *kg, int object)
return make_float3(f.x, f.y, 0.0f);
}
+ccl_device_inline void object_motion_info(KernelGlobals *kg, int object, int *numsteps, int *numverts, int *numkeys)
+{
+ int offset = object*OBJECT_SIZE + OBJECT_DUPLI;
+
+ if(numkeys) {
+ float4 f = kernel_tex_fetch(__objects, offset);
+ *numkeys = __float_as_int(f.w);
+ }
+
+ float4 f = kernel_tex_fetch(__objects, offset + 1);
+ if(numsteps)
+ *numsteps = __float_as_int(f.z);
+ if(numverts)
+ *numverts = __float_as_int(f.w);
+}
ccl_device int shader_pass_id(KernelGlobals *kg, ShaderData *sd)
{