diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-04-30 16:49:26 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-04-30 16:49:26 +0400 |
commit | 1d8c79818870b92df46c443d7778438aa67d019c (patch) | |
tree | ba3fc305671261e40851d8a230a33ebe19396e95 /intern/cycles/kernel/kernel_passes.h | |
parent | 796dd8a321108df26757fb9df5c2aa6eb42c9633 (diff) |
Cycles: support for motion vector and UV passes.
Most of the changes are related to adding support for motion data throughout
the code. There's some code for actual camera/object motion blur raytracing
but it's unfinished (it badly slows down the raytracing kernel even when the
option is turned off), so that code it disabled still.
Motion vector export from Blender tries to avoid computing derived meshes
when the mesh does not have a deforming modifier, and it also won't store
motion vectors for every vertex if only the object or camera is moving.
Diffstat (limited to 'intern/cycles/kernel/kernel_passes.h')
-rw-r--r-- | intern/cycles/kernel/kernel_passes.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_passes.h b/intern/cycles/kernel/kernel_passes.h index fd4ee17cdc1..f3ddda4a392 100644 --- a/intern/cycles/kernel/kernel_passes.h +++ b/intern/cycles/kernel/kernel_passes.h @@ -72,9 +72,14 @@ __device_inline void kernel_write_data_passes(KernelGlobals *kg, __global float kernel_write_pass_float3(buffer + kernel_data.film.pass_normal, sample, normal); } if(flag & PASS_UV) { - float3 uv = make_float3(0.0f, 0.0f, 0.0f); /* todo: request and lookup */ + float3 uv = triangle_uv(kg, sd); kernel_write_pass_float3(buffer + kernel_data.film.pass_uv, sample, uv); } + if(flag & PASS_MOTION) { + float4 speed = triangle_motion_vector(kg, sd); + kernel_write_pass_float4(buffer + kernel_data.film.pass_motion, sample, speed); + kernel_write_pass_float(buffer + kernel_data.film.pass_motion_weight, sample, 1.0f); + } } if(flag & (PASS_DIFFUSE_INDIRECT|PASS_DIFFUSE_COLOR|PASS_DIFFUSE_DIRECT)) |