cleanup: remove unused passes
authorPhilipp Oeser <info@graphics-engineer.com>
Fri, 21 Dec 2018 22:26:04 +0000 (23:26 +0100)
committerPhilipp Oeser <info@graphics-engineer.com>
Thu, 27 Dec 2018 14:22:33 +0000 (15:22 +0100)
- use_pass_indirect, use_pass_specular from ViewLayer RNA
- RGBA, DIFFUSE, SPEC, REFLECT, REFRACT, INDIRECT usages from remaining
places

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4117

source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_scene.c
source/blender/nodes/composite/nodes/node_composite_image.c
source/blender/render/intern/source/bake_api.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c

index 0548d49dce002ba7566dd2e31bf979dd8196b3f0..3486980fa653e990cb87c3525114f7a472aa1d6f 100644 (file)
@@ -447,7 +447,7 @@ static void prepare(Render *re, ViewLayer *view_layer)
        RenderLayer *rl = RE_GetRenderLayer(re->result, view_layer->name);
        bool diffuse = false, z = false;
        for (RenderPass *rpass = (RenderPass *)rl->passes.first; rpass; rpass = rpass->next) {
-               if (STREQ(rpass->name, RE_PASSNAME_DIFFUSE)) {
+               if (STREQ(rpass->name, RE_PASSNAME_DIFFUSE_COLOR)) {
                        controller->setPassDiffuse(rpass->rect, rpass->rectx, rpass->recty);
                        diffuse = true;
                }
index 467d70ffd81923d3e387d4e5a7bd40213c4e1e4c..ad33c57b3c8ee7fef8773d5b3ad22a7bb032ae2e 100644 (file)
@@ -234,18 +234,18 @@ typedef struct SceneRenderLayer {
 typedef enum eScenePassType {
        SCE_PASS_COMBINED                 = (1 << 0),
        SCE_PASS_Z                        = (1 << 1),
-       SCE_PASS_RGBA                     = (1 << 2),
-       SCE_PASS_DIFFUSE                  = (1 << 3),
-       SCE_PASS_SPEC                     = (1 << 4),
+       SCE_PASS_DEPRECATED_1             = (1 << 2), /* RGBA */
+       SCE_PASS_DEPRECATED_2             = (1 << 3), /* DIFFUSE */
+       SCE_PASS_DEPRECATED_3             = (1 << 4), /* SPEC */
        SCE_PASS_SHADOW                   = (1 << 5),
        SCE_PASS_AO                       = (1 << 6),
-       SCE_PASS_REFLECT                  = (1 << 7),
+       SCE_PASS_DEPRECATED_4             = (1 << 7), /* REFLECT */
        SCE_PASS_NORMAL                   = (1 << 8),
        SCE_PASS_VECTOR                   = (1 << 9),
-       SCE_PASS_REFRACT                  = (1 << 10),
+       SCE_PASS_DEPRECATED_5             = (1 << 10), /* REFRACT */
        SCE_PASS_INDEXOB                  = (1 << 11),
        SCE_PASS_UV                       = (1 << 12),
-       SCE_PASS_INDIRECT                 = (1 << 13),
+       SCE_PASS_DEPRECATED_6             = (1 << 13), /* INDIRECT */
        SCE_PASS_MIST                     = (1 << 14),
        SCE_PASS_RAYHITS                  = (1 << 15),
        SCE_PASS_EMIT                     = (1 << 16),
@@ -271,17 +271,11 @@ typedef enum eScenePassType {
 #define RE_PASSNAME_VECTOR "Vector"
 #define RE_PASSNAME_NORMAL "Normal"
 #define RE_PASSNAME_UV "UV"
-#define RE_PASSNAME_RGBA "Color"
 #define RE_PASSNAME_EMIT "Emit"
-#define RE_PASSNAME_DIFFUSE "Diffuse"
-#define RE_PASSNAME_SPEC "Spec"
 #define RE_PASSNAME_SHADOW "Shadow"
 
 #define RE_PASSNAME_AO "AO"
 #define RE_PASSNAME_ENVIRONMENT "Env"
-#define RE_PASSNAME_INDIRECT "Indirect"
-#define RE_PASSNAME_REFLECT "Reflect"
-#define RE_PASSNAME_REFRACT "Refract"
 #define RE_PASSNAME_INDEXOB "IndexOB"
 #define RE_PASSNAME_INDEXMA "IndexMA"
 #define RE_PASSNAME_MIST "Mist"
index 46b77b80d49194a4a8d785fc7b0900d971ba2234..9836dfdfbc9043fb1ed29bad8b7795f086edced1 100644 (file)
 const EnumPropertyItem rna_enum_render_pass_type_items[] = {
        {SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
        {SCE_PASS_Z, "Z", 0, "Z", ""},
-       {SCE_PASS_RGBA, "COLOR", 0, "Color", ""},
-       {SCE_PASS_DIFFUSE, "DIFFUSE", 0, "Diffuse", ""},
-       {SCE_PASS_SPEC, "SPECULAR", 0, "Specular", ""},
        {SCE_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
        {SCE_PASS_AO, "AO", 0, "Ambient Occlusion", ""},
-       {SCE_PASS_REFLECT, "REFLECTION", 0, "Reflection", ""},
        {SCE_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
        {SCE_PASS_VECTOR, "VECTOR", 0, "Vector", ""},
-       {SCE_PASS_REFRACT, "REFRACTION", 0, "Refraction", ""},
        {SCE_PASS_INDEXOB, "OBJECT_INDEX", 0, "Object Index", ""},
        {SCE_PASS_UV, "UV", 0, "UV", ""},
        {SCE_PASS_MIST, "MIST", 0, "Mist", ""},
index a9a23ad4cea66a3de0918735d9898ea055626bec..9389dcf81ef0e668b49532c0659cb766b2016912 100644 (file)
@@ -3345,12 +3345,6 @@ void rna_def_view_layer_common(StructRNA *srna, int scene)
        if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 
-       prop = RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
-       RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
-       if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
-       else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-
        prop = RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
        RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
@@ -3375,12 +3369,6 @@ void rna_def_view_layer_common(StructRNA *srna, int scene)
        if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
        else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 
-       prop = RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
-       RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
-       if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
-       else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-
        prop = RNA_def_property(srna, "use_pass_diffuse_direct", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE_DIRECT);
        RNA_def_property_ui_text(prop, "Diffuse Direct", "Deliver diffuse direct pass");
index 3ee4e512d767470711568620e5ce62882e7af3cf..8d400ada0c7cf914c13c67b6044776e2ae6cf4a9 100644 (file)
@@ -52,14 +52,8 @@ static bNodeSocketTemplate cmp_node_rlayers_out[] = {
        {       SOCK_VECTOR, 0, N_(RE_PASSNAME_NORMAL),                                 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_VECTOR, 0, N_(RE_PASSNAME_UV),                                             1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_VECTOR, 0, N_(RE_PASSNAME_VECTOR),                                 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_RGBA,   0, N_(RE_PASSNAME_RGBA),                                   0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_RGBA,   0, N_(RE_PASSNAME_DIFFUSE),                                0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_RGBA,   0, N_(RE_PASSNAME_SPEC),                                   0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_RGBA,   0, N_(RE_PASSNAME_SHADOW),                                 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_RGBA,   0, N_(RE_PASSNAME_AO),                                             0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_RGBA,   0, N_(RE_PASSNAME_REFLECT),                                0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_RGBA,   0, N_(RE_PASSNAME_REFRACT),                                0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_RGBA,   0, N_(RE_PASSNAME_INDIRECT),                               0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_FLOAT,  0, N_(RE_PASSNAME_INDEXOB),                                0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_FLOAT,  0, N_(RE_PASSNAME_INDEXMA),                                0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_FLOAT,  0, N_(RE_PASSNAME_MIST),                                   0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
@@ -360,9 +354,7 @@ const char *node_cmp_rlayers_sock_to_pass(int sock_index)
 {
        const char *sock_to_passname[] = {
                RE_PASSNAME_COMBINED, RE_PASSNAME_COMBINED,
-               RE_PASSNAME_Z, RE_PASSNAME_NORMAL, RE_PASSNAME_UV, RE_PASSNAME_VECTOR, RE_PASSNAME_RGBA,
-               RE_PASSNAME_DIFFUSE, RE_PASSNAME_SPEC, RE_PASSNAME_SHADOW, RE_PASSNAME_AO,
-               RE_PASSNAME_REFLECT, RE_PASSNAME_REFRACT, RE_PASSNAME_INDIRECT,
+               RE_PASSNAME_Z, RE_PASSNAME_NORMAL, RE_PASSNAME_UV, RE_PASSNAME_VECTOR, RE_PASSNAME_SHADOW, RE_PASSNAME_AO,
                RE_PASSNAME_INDEXOB, RE_PASSNAME_INDEXMA, RE_PASSNAME_MIST, RE_PASSNAME_EMIT, RE_PASSNAME_ENVIRONMENT,
                RE_PASSNAME_DIFFUSE_DIRECT, RE_PASSNAME_DIFFUSE_INDIRECT, RE_PASSNAME_DIFFUSE_COLOR,
                RE_PASSNAME_GLOSSY_DIRECT, RE_PASSNAME_GLOSSY_INDIRECT, RE_PASSNAME_GLOSSY_COLOR,
index c906413d7d7a1ad18402538ba1049f7f2d79dfbb..6aa888d9f900446930be68dae9e3475bc1044401 100644 (file)
@@ -954,20 +954,11 @@ int RE_pass_depth(const eScenePassType pass_type)
                {
                        return 2;
                }
-               case SCE_PASS_RGBA:
-               {
-                       return 4;
-               }
                case SCE_PASS_COMBINED:
-               case SCE_PASS_DIFFUSE:
-               case SCE_PASS_SPEC:
                case SCE_PASS_SHADOW:
-               case SCE_PASS_REFLECT:
                case SCE_PASS_NORMAL:
                case SCE_PASS_VECTOR:
-               case SCE_PASS_REFRACT:
                case SCE_PASS_INDEXOB:  /* XXX double check */
-               case SCE_PASS_INDIRECT:
                case SCE_PASS_RAYHITS:  /* XXX double check */
                case SCE_PASS_EMIT:
                case SCE_PASS_ENVIRONMENT:
index f3b1cc0d529ae77632c73e23014fe565ce259e2d..188da973f498212ea136dbd67a60e705128aa99e 100644 (file)
@@ -2783,16 +2783,10 @@ RenderPass *RE_pass_find_by_type(volatile RenderLayer *rl, int passtype, const c
        CHECK_PASS(VECTOR);
        CHECK_PASS(NORMAL);
        CHECK_PASS(UV);
-       CHECK_PASS(RGBA);
        CHECK_PASS(EMIT);
-       CHECK_PASS(DIFFUSE);
-       CHECK_PASS(SPEC);
        CHECK_PASS(SHADOW);
        CHECK_PASS(AO);
        CHECK_PASS(ENVIRONMENT);
-       CHECK_PASS(INDIRECT);
-       CHECK_PASS(REFLECT);
-       CHECK_PASS(REFRACT);
        CHECK_PASS(INDEXOB);
        CHECK_PASS(INDEXMA);
        CHECK_PASS(MIST);
index ea5ca18d58aa91b68522728081baf20b016233ec..fc99be81ba3aa8d83ccbd4275b5d82ef7c4c1c0f 100644 (file)
@@ -350,26 +350,14 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
                                RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_NORMAL, view, "XYZ");
                        if (view_layer->passflag  & SCE_PASS_UV)
                                RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_UV, view, "UVA");
-                       if (view_layer->passflag  & SCE_PASS_RGBA)
-                               RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_RGBA, view, "RGBA");
                        if (view_layer->passflag  & SCE_PASS_EMIT)
                                RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_EMIT, view, "RGB");
-                       if (view_layer->passflag  & SCE_PASS_DIFFUSE)
-                               RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE, view, "RGB");
-                       if (view_layer->passflag  & SCE_PASS_SPEC)
-                               RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SPEC, view, "RGB");
                        if (view_layer->passflag  & SCE_PASS_AO)
                                RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_AO, view, "RGB");
                        if (view_layer->passflag  & SCE_PASS_ENVIRONMENT)
                                RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_ENVIRONMENT, view, "RGB");
-                       if (view_layer->passflag  & SCE_PASS_INDIRECT)
-                               RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_INDIRECT, view, "RGB");
                        if (view_layer->passflag  & SCE_PASS_SHADOW)
                                RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SHADOW, view, "RGB");
-                       if (view_layer->passflag  & SCE_PASS_REFLECT)
-                               RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_REFLECT, view, "RGB");
-                       if (view_layer->passflag  & SCE_PASS_REFRACT)
-                               RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_REFRACT, view, "RGB");
                        if (view_layer->passflag  & SCE_PASS_INDEXOB)
                                RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_INDEXOB, view, "X");
                        if (view_layer->passflag  & SCE_PASS_INDEXMA)
@@ -517,16 +505,10 @@ static int passtype_from_name(const char *name)
        CHECK_PASS(VECTOR);
        CHECK_PASS(NORMAL);
        CHECK_PASS(UV);
-       CHECK_PASS(RGBA);
        CHECK_PASS(EMIT);
-       CHECK_PASS(DIFFUSE);
-       CHECK_PASS(SPEC);
        CHECK_PASS(SHADOW);
        CHECK_PASS(AO);
        CHECK_PASS(ENVIRONMENT);
-       CHECK_PASS(INDIRECT);
-       CHECK_PASS(REFLECT);
-       CHECK_PASS(REFRACT);
        CHECK_PASS(INDEXOB);
        CHECK_PASS(INDEXMA);
        CHECK_PASS(MIST);