Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2021-06-28 19:49:55 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2021-06-28 20:09:15 +0300
commita5ed075110031792212a7f6b8a171242a3f428e8 (patch)
tree68b4f93c2edcbba8e449904505a33954aa125e4c /intern/cycles/kernel/geom/geom_primitive.h
parentafb17552e19c56daab6928ed1e2514b962770e19 (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/geom/geom_primitive.h')
-rw-r--r--intern/cycles/kernel/geom/geom_primitive.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/kernel/geom/geom_primitive.h b/intern/cycles/kernel/geom/geom_primitive.h
index 2c31e5cee03..aeb044c9ad3 100644
--- a/intern/cycles/kernel/geom/geom_primitive.h
+++ b/intern/cycles/kernel/geom/geom_primitive.h
@@ -138,7 +138,7 @@ ccl_device_inline float4 primitive_surface_attribute_float4(KernelGlobals *kg,
ccl_device_inline bool primitive_is_volume_attribute(const ShaderData *sd,
const AttributeDescriptor desc)
{
- return (sd->object != OBJECT_NONE && desc.element == ATTR_ELEMENT_VOXEL);
+ return sd->type == PRIMITIVE_VOLUME;
}
ccl_device_inline float primitive_volume_attribute_float(KernelGlobals *kg,