Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/geom/motion_triangle.h
| Show All 37 Lines | ccl_device_inline void motion_triangle_verts_for_step(KernelGlobals kg, | ||||
| int offset, | int offset, | ||||
| int numverts, | int numverts, | ||||
| int numsteps, | int numsteps, | ||||
| int step, | int step, | ||||
| float3 verts[3]) | float3 verts[3]) | ||||
| { | { | ||||
| if (step == numsteps) { | if (step == numsteps) { | ||||
| /* center step: regular vertex location */ | /* center step: regular vertex location */ | ||||
| verts[0] = float4_to_float3(kernel_tex_fetch(__tri_verts, tri_vindex.w + 0)); | verts[0] = kernel_tex_fetch(__tri_verts, tri_vindex.w + 0); | ||||
| verts[1] = float4_to_float3(kernel_tex_fetch(__tri_verts, tri_vindex.w + 1)); | verts[1] = kernel_tex_fetch(__tri_verts, tri_vindex.w + 1); | ||||
| verts[2] = float4_to_float3(kernel_tex_fetch(__tri_verts, tri_vindex.w + 2)); | verts[2] = kernel_tex_fetch(__tri_verts, tri_vindex.w + 2); | ||||
| } | } | ||||
| else { | else { | ||||
| /* center step not store in this array */ | /* center step not store in this array */ | ||||
| if (step > numsteps) | if (step > numsteps) | ||||
| step--; | step--; | ||||
| offset += step * numverts; | offset += step * numverts; | ||||
| verts[0] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.x)); | verts[0] = kernel_tex_fetch(__attributes_float3, offset + tri_vindex.x); | ||||
| verts[1] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.y)); | verts[1] = kernel_tex_fetch(__attributes_float3, offset + tri_vindex.y); | ||||
| verts[2] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.z)); | verts[2] = kernel_tex_fetch(__attributes_float3, offset + tri_vindex.z); | ||||
| } | } | ||||
| } | } | ||||
| ccl_device_inline void motion_triangle_normals_for_step(KernelGlobals kg, | ccl_device_inline void motion_triangle_normals_for_step(KernelGlobals kg, | ||||
| uint4 tri_vindex, | uint4 tri_vindex, | ||||
| int offset, | int offset, | ||||
| int numverts, | int numverts, | ||||
| int numsteps, | int numsteps, | ||||
| int step, | int step, | ||||
| float3 normals[3]) | float3 normals[3]) | ||||
| { | { | ||||
| if (step == numsteps) { | if (step == numsteps) { | ||||
| /* center step: regular vertex location */ | /* center step: regular vertex location */ | ||||
| normals[0] = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.x)); | normals[0] = kernel_tex_fetch(__tri_vnormal, tri_vindex.x); | ||||
| normals[1] = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.y)); | normals[1] = kernel_tex_fetch(__tri_vnormal, tri_vindex.y); | ||||
| normals[2] = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.z)); | normals[2] = kernel_tex_fetch(__tri_vnormal, tri_vindex.z); | ||||
| } | } | ||||
| else { | else { | ||||
| /* center step is not stored in this array */ | /* center step is not stored in this array */ | ||||
| if (step > numsteps) | if (step > numsteps) | ||||
| step--; | step--; | ||||
| offset += step * numverts; | offset += step * numverts; | ||||
| normals[0] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.x)); | normals[0] = kernel_tex_fetch(__attributes_float3, offset + tri_vindex.x); | ||||
| normals[1] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.y)); | normals[1] = kernel_tex_fetch(__attributes_float3, offset + tri_vindex.y); | ||||
| normals[2] = float4_to_float3(kernel_tex_fetch(__attributes_float3, offset + tri_vindex.z)); | normals[2] = kernel_tex_fetch(__attributes_float3, offset + tri_vindex.z); | ||||
| } | } | ||||
| } | } | ||||
| ccl_device_inline void motion_triangle_vertices( | ccl_device_inline void motion_triangle_vertices( | ||||
| KernelGlobals kg, int object, int prim, float time, float3 verts[3]) | KernelGlobals kg, int object, int prim, float time, float3 verts[3]) | ||||
| { | { | ||||
| /* get motion info */ | /* get motion info */ | ||||
| int numsteps, numverts; | int numsteps, numverts; | ||||
| ▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines | |||||