28 const uint3 tri_vindex,
35 const int center_step = (numsteps - 1) / 2;
36 if (
step == center_step) {
41 if (
step < center_step) {
44 offset +=
step * numverts;
54 const int object_flag,
56 const uint3 tri_vindex,
62 const int center_step = (numsteps - 1) / 2;
63 if (
step == center_step) {
75 if (
step < center_step) {
78 offset +=
step * stride;
109 const int maxstep = *numsteps - 1;
110 *
step =
min((
int)(time * maxstep), maxstep - 1);
111 *t = time * maxstep - *
step;
119 const uint3 tri_vindex,
133 verts[0] = (1.0f - t) * verts[0] + t * next_verts[0];
134 verts[1] = (1.0f - t) * verts[1] + t * next_verts[1];
135 verts[2] = (1.0f - t) * verts[2] + t * next_verts[2];
154 const uint3 tri_vindex,
165 kg,
object, object_flag, prim, tri_vindex, offset, numsteps,
step, normals);
167 kg,
object, object_flag, prim, tri_vindex, offset, numsteps,
step + 1, next_normals);
170 normals[0] =
normalize((1.0f - t) * normals[0] + t * next_normals[0]);
171 normals[1] =
normalize((1.0f - t) * normals[1] + t * next_normals[1]);
172 normals[2] =
normalize((1.0f - t) * normals[2] + t * next_normals[2]);
180 const int object = sd->object;
195 const uint3 tri_vindex,
206 const float w = 1.0f - u - v;
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
#define kernel_data_fetch(name, index)
#define ccl_device_inline
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN ccl_device_inline T triangle_interpolate(const float u, const float v, const T f0, const T f1, const T f2)
VecBase< float, D > normalize(VecOp< float, D >) RET
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
VecT safe_normalize(VecT vector)
ccl_device_inline void attribute_data_fetch_normals(KernelGlobals kg, const int offset, const int i0, const int i1, const int i2, ccl_private float3 N[3])
@ SD_OBJECT_HAS_CORNER_NORMALS
ccl_device_inline void motion_triangle_vertices(KernelGlobals kg, const int object, const uint3 tri_vindex, const int numsteps, const int numverts, const int step, const float t, float3 verts[3])
ccl_device_inline float3 motion_triangle_smooth_normal(KernelGlobals kg, const float3 Ng, const int object, const int prim, const uint3 tri_vindex, const int numsteps, const int step, const float t, const float u, const float v)
ccl_device_inline void motion_triangle_vertices_and_normals(KernelGlobals kg, const ccl_private ShaderData *sd, float3 verts[3], float3 normals[3])
ccl_device_inline void motion_triangle_compute_info(KernelGlobals kg, const int object, const float time, const int prim, ccl_private uint3 *tri_vindex, ccl_private int *numsteps, ccl_private int *step, ccl_private float *t)
ccl_device_inline void motion_triangle_normals(KernelGlobals kg, const int object, const int prim, const uint3 tri_vindex, const int numsteps, const int step, const float t, float3 normals[3])
CCL_NAMESPACE_BEGIN ccl_device_inline void motion_triangle_verts_for_step(KernelGlobals kg, const uint3 tri_vindex, int offset, const int numverts, const int numsteps, int step, float3 verts[3])
ccl_device_inline void motion_triangle_normals_for_step(KernelGlobals kg, const int object, const int object_flag, const int prim, const uint3 tri_vindex, int offset, const int numsteps, int step, float3 normals[3])