Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/geom/attribute.h
| Show All 21 Lines | |||||
| * | * | ||||
| * We support an arbitrary number of attributes on various mesh elements. | * We support an arbitrary number of attributes on various mesh elements. | ||||
| * On vertices, triangles, curve keys, curves, meshes and volume grids. | * On vertices, triangles, curve keys, curves, meshes and volume grids. | ||||
| * Most of the code for attribute reading is in the primitive files. | * Most of the code for attribute reading is in the primitive files. | ||||
| * | * | ||||
| * Lookup of attributes is different between OSL and SVM, as OSL is ustring | * Lookup of attributes is different between OSL and SVM, as OSL is ustring | ||||
| * based while for SVM we use integer ids. */ | * based while for SVM we use integer ids. */ | ||||
| ccl_device_inline uint subd_triangle_patch(KernelGlobals kg, ccl_private const ShaderData *sd); | /* 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; | |||||
| } | |||||
| ccl_device_inline uint attribute_primitive_type(KernelGlobals kg, ccl_private const ShaderData *sd) | ccl_device_inline uint attribute_primitive_type(KernelGlobals kg, ccl_private const ShaderData *sd) | ||||
| { | { | ||||
| if ((sd->type & PRIMITIVE_ALL_TRIANGLE) && subd_triangle_patch(kg, sd) != ~0) { | if ((sd->type & PRIMITIVE_ALL_TRIANGLE) && subd_triangle_patch(kg, sd) != ~0) { | ||||
| return ATTR_PRIM_SUBD; | return ATTR_PRIM_SUBD; | ||||
| } | } | ||||
| else { | else { | ||||
| return ATTR_PRIM_GEOMETRY; | return ATTR_PRIM_GEOMETRY; | ||||
| ▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines | |||||