diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2021-06-28 19:49:55 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2021-06-28 20:09:15 +0300 |
commit | a5ed075110031792212a7f6b8a171242a3f428e8 (patch) | |
tree | 68b4f93c2edcbba8e449904505a33954aa125e4c /intern/cycles/kernel/kernel_types.h | |
parent | afb17552e19c56daab6928ed1e2514b962770e19 (diff) |
Fix T87194: custom attributes not accessible with Cycles Volume
Custom properties defined on objects are not accessible from the
attribute node when rendering a volume in Cycles. This is because
this case is not handled.
To handle it, added a primitive type for volumes in the kernel,
which is then used in the initialization of ShaderData and to
check whether an attribute lookup is for a volume.
`volume_attribute_float4` is also now checking the attribute
element type to dispatch to the right lookup function.
Reviewed By: #cycles, brecht
Maniphest Tasks: T87194
Differential Revision: https://developer.blender.org/D11728
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 85d75b36e5f..48aa2ca76e6 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -694,17 +694,20 @@ typedef enum PrimitiveType { */ PRIMITIVE_LAMP = (1 << 6), + PRIMITIVE_VOLUME = (1 << 7), + PRIMITIVE_ALL_TRIANGLE = (PRIMITIVE_TRIANGLE | PRIMITIVE_MOTION_TRIANGLE), PRIMITIVE_ALL_CURVE = (PRIMITIVE_CURVE_THICK | PRIMITIVE_MOTION_CURVE_THICK | PRIMITIVE_CURVE_RIBBON | PRIMITIVE_MOTION_CURVE_RIBBON), + PRIMITIVE_ALL_VOLUME = (PRIMITIVE_VOLUME), PRIMITIVE_ALL_MOTION = (PRIMITIVE_MOTION_TRIANGLE | PRIMITIVE_MOTION_CURVE_THICK | PRIMITIVE_MOTION_CURVE_RIBBON), - PRIMITIVE_ALL = (PRIMITIVE_ALL_TRIANGLE | PRIMITIVE_ALL_CURVE), + PRIMITIVE_ALL = (PRIMITIVE_ALL_TRIANGLE | PRIMITIVE_ALL_CURVE | PRIMITIVE_ALL_VOLUME), /* Total number of different traceable primitives. * NOTE: This is an actual value, not a bitflag. */ - PRIMITIVE_NUM_TOTAL = 6, + PRIMITIVE_NUM_TOTAL = 7, } PrimitiveType; #define PRIMITIVE_PACK_SEGMENT(type, segment) ((segment << PRIMITIVE_NUM_TOTAL) | (type)) |