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:
authorDilith Jayakody <dilithjay@gmail.com>2022-04-03 05:38:54 +0300
committerDilith Jayakody <dilithjay@gmail.com>2022-04-03 05:38:54 +0300
commitbb44667a2e8f9c91548a574443e750583918e996 (patch)
tree12347d0a95971a9b7cd7d11786ccc2f948b214c6 /intern/cycles/scene/object.cpp
parent2579367c93296eb2ab1da0b51dc107287dc09fd3 (diff)
parent79ff65d07bac0ecf0170542f86dc03a0228b53d5 (diff)
Merge branch 'master' into soc-2021-curvessoc-2021-curves
Diffstat (limited to 'intern/cycles/scene/object.cpp')
-rw-r--r--intern/cycles/scene/object.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/intern/cycles/scene/object.cpp b/intern/cycles/scene/object.cpp
index 9b19169880a..55d89fc3673 100644
--- a/intern/cycles/scene/object.cpp
+++ b/intern/cycles/scene/object.cpp
@@ -98,6 +98,8 @@ NODE_DEFINE(Object)
SOCKET_FLOAT(ao_distance, "AO Distance", 0.0f);
+ SOCKET_STRING(lightgroup, "Light Group", ustring());
+
return type;
}
@@ -393,7 +395,8 @@ static float object_volume_density(const Transform &tfm, Geometry *geom)
void ObjectManager::device_update_object_transform(UpdateObjectTransformState *state,
Object *ob,
- bool update_all)
+ bool update_all,
+ const Scene *scene)
{
KernelObject &kobject = state->objects[ob->index];
Transform *object_motion_pass = state->object_motion_pass;
@@ -532,6 +535,15 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s
if (geom->geometry_type == Geometry::HAIR) {
state->have_curves = true;
}
+
+ /* Light group. */
+ auto it = scene->lightgroups.find(ob->lightgroup);
+ if (it != scene->lightgroups.end()) {
+ kobject.lightgroup = it->second;
+ }
+ else {
+ kobject.lightgroup = LIGHTGROUP_NONE;
+ }
}
void ObjectManager::device_update_prim_offsets(Device *device, DeviceScene *dscene, Scene *scene)
@@ -618,7 +630,7 @@ void ObjectManager::device_update_transforms(DeviceScene *dscene, Scene *scene,
[&](const blocked_range<size_t> &r) {
for (size_t i = r.begin(); i != r.end(); i++) {
Object *ob = state.scene->objects[i];
- device_update_object_transform(&state, ob, update_all);
+ device_update_object_transform(&state, ob, update_all, scene);
}
});