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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-18 05:20:39 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-23 20:57:58 +0300
commita963c7d48dade70474ec3b40bea5e99ebdbbc5d4 (patch)
tree7df66a8c09dec4f9bd1f9eb1f9d390339213c21d /intern/cycles/render/object.cpp
parent4448ed6c5e6d321c9f0822ca2d969f7e7041fe27 (diff)
Code refactor: improve attribute handling for optional volume attributes.
A volume shader should be able to request attributes, and still be rendered as homogeneous if no volume attributes are available for the object.
Diffstat (limited to 'intern/cycles/render/object.cpp')
-rw-r--r--intern/cycles/render/object.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp
index e03160954bc..b981d2b8849 100644
--- a/intern/cycles/render/object.cpp
+++ b/intern/cycles/render/object.cpp
@@ -604,9 +604,16 @@ void ObjectManager::device_update_flags(Device *,
foreach(Object *object, scene->objects) {
if(object->mesh->has_volume) {
object_flag[object_index] |= SD_OBJECT_HAS_VOLUME;
+ object_flag[object_index] &= ~SD_OBJECT_HAS_VOLUME_ATTRIBUTES;
+
+ foreach(Attribute& attr, object->mesh->attributes.attributes) {
+ if(attr.element == ATTR_ELEMENT_VOXEL) {
+ object_flag[object_index] |= SD_OBJECT_HAS_VOLUME_ATTRIBUTES;
+ }
+ }
}
else {
- object_flag[object_index] &= ~SD_OBJECT_HAS_VOLUME;
+ object_flag[object_index] &= ~(SD_OBJECT_HAS_VOLUME|SD_OBJECT_HAS_VOLUME_ATTRIBUTES);
}
if(object->is_shadow_catcher) {
object_flag[object_index] |= SD_OBJECT_SHADOW_CATCHER;