diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2022-04-02 01:11:11 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2022-04-02 07:14:27 +0300 |
commit | ad35453cd19b3db779b0b3a90feac2e93c7a73cf (patch) | |
tree | 3ad7893815bda3e34e18302422ad1f978e828603 /source/blender/blenkernel/BKE_layer.h | |
parent | 5387d33e5f954c4cecdb7ffd3d1042d8632d6c15 (diff) |
Cycles: Add support for light groups
Light groups are a type of pass that only contains lighting from a subset of light sources.
They are created in the View layer, and light sources (lamps, objects with emissive materials
and/or the environment) can be assigned to a group.
Currently, each light group ends up generating its own version of the Combined pass.
In the future, additional types of passes (e.g. shadowcatcher) might be getting their own
per-lightgroup versions.
The lightgroup creation and assignment is not Cycles-specific, so Eevee or external render
engines could make use of it in the future.
Note that Lightgroups are identified by their name - therefore, the name of the Lightgroup
in the View Layer and the name that's set in an object's settings must match for it to be
included.
Currently, changing a Lightgroup's name does not update objects - this is planned for the
future, along with other features such as denoising for light groups and viewing them in
preview renders.
Original patch by Alex Fuller (@mistaed), with some polishing by Lukas Stockner (@lukasstockner97).
Differential Revision: https://developer.blender.org/D12871
Diffstat (limited to 'source/blender/blenkernel/BKE_layer.h')
-rw-r--r-- | source/blender/blenkernel/BKE_layer.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index c877035830c..4a3917dafee 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -8,6 +8,7 @@ #include "BKE_collection.h" +#include "DNA_layer_types.h" #include "DNA_listBase.h" #ifdef __cplusplus @@ -581,6 +582,21 @@ bool BKE_view_layer_has_valid_aov(struct ViewLayer *view_layer); struct ViewLayer *BKE_view_layer_find_with_aov(struct Scene *scene, struct ViewLayerAOV *view_layer_aov); +struct ViewLayerLightgroup *BKE_view_layer_add_lightgroup(struct ViewLayer *view_layer); +void BKE_view_layer_remove_lightgroup(struct ViewLayer *view_layer, + struct ViewLayerLightgroup *lightgroup); +void BKE_view_layer_set_active_lightgroup(struct ViewLayer *view_layer, + struct ViewLayerLightgroup *lightgroup); +struct ViewLayer *BKE_view_layer_find_with_lightgroup( + struct Scene *scene, struct ViewLayerLightgroup *view_layer_lightgroup); +void BKE_view_layer_rename_lightgroup(ViewLayer *view_layer, + ViewLayerLightgroup *lightgroup, + const char *name); + +void BKE_lightgroup_membership_get(struct LightgroupMembership *lgm, char *value); +int BKE_lightgroup_membership_length(struct LightgroupMembership *lgm); +void BKE_lightgroup_membership_set(struct LightgroupMembership **lgm, const char *value); + #ifdef __cplusplus } #endif |