Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/geom/subd_triangle.h
| Show All 14 Lines | |||||
| */ | */ | ||||
| /* Functions for retrieving attributes on triangles produced from subdivision meshes */ | /* Functions for retrieving attributes on triangles produced from subdivision meshes */ | ||||
| #pragma once | #pragma once | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| /* Patch index for triangle, -1 if not subdivision triangle */ | |||||
| ccl_device_inline uint subd_triangle_patch(KernelGlobals kg, ccl_private const ShaderData *sd) | |||||
| { | |||||
| return (sd->prim != PRIM_NONE) ? kernel_tex_fetch(__tri_patch, sd->prim) : ~0; | |||||
| } | |||||
| /* UV coords of triangle within patch */ | /* UV coords of triangle within patch */ | ||||
| ccl_device_inline void subd_triangle_patch_uv(KernelGlobals kg, | ccl_device_inline void subd_triangle_patch_uv(KernelGlobals kg, | ||||
| ccl_private const ShaderData *sd, | ccl_private const ShaderData *sd, | ||||
| float2 uv[3]) | float2 uv[3]) | ||||
| { | { | ||||
| uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim); | uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim); | ||||
| ▲ Show 20 Lines • Show All 650 Lines • Show Last 20 Lines | |||||