Fix #21211: new indirect/environment/emit passes weren't showing up
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 12 Mar 2010 12:29:12 +0000 (12:29 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 12 Mar 2010 12:29:12 +0000 (12:29 +0000)
in compositor and outliner yet.

source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/node.c
source/blender/editors/space_outliner/outliner.c
source/blender/makesdna/DNA_scene_types.h
source/blender/nodes/intern/CMP_nodes/CMP_image.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/zbuf.c

index a6ebb72320cf2a6d50d6d143fcb7f62116312524..0e5ad8e3ee94ef63d4e570854e1316cf4537322c 100644 (file)
@@ -290,9 +290,11 @@ void                       ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat);
 #define RRES_OUT_AO                    10
 #define RRES_OUT_REFLECT       11
 #define RRES_OUT_REFRACT       12
-#define RRES_OUT_RADIO         13
+#define RRES_OUT_INDIRECT      13
 #define RRES_OUT_INDEXOB       14
 #define RRES_OUT_MIST          15
+#define RRES_OUT_EMIT          16
+#define RRES_OUT_ENV           17
 
 /* note: types are needed to restore callbacks, don't change values */
 #define CMP_NODE_VIEWER                201
index 844139dd87149d697cbe35b13e730ffd7f3eead8..77e54fe6769ff9ed74467e200096092dc30b7be0 100644 (file)
@@ -2809,12 +2809,16 @@ static void force_hidden_passes(bNode *node, int passflag)
        if(!(passflag & SCE_PASS_REFLECT)) sock->flag |= SOCK_UNAVAIL;
        sock= BLI_findlink(&node->outputs, RRES_OUT_REFRACT);
        if(!(passflag & SCE_PASS_REFRACT)) sock->flag |= SOCK_UNAVAIL;
-       sock= BLI_findlink(&node->outputs, RRES_OUT_RADIO);
-       if(!(passflag & SCE_PASS_RADIO)) sock->flag |= SOCK_UNAVAIL;
+       sock= BLI_findlink(&node->outputs, RRES_OUT_INDIRECT);
+       if(!(passflag & SCE_PASS_INDIRECT)) sock->flag |= SOCK_UNAVAIL;
        sock= BLI_findlink(&node->outputs, RRES_OUT_INDEXOB);
        if(!(passflag & SCE_PASS_INDEXOB)) sock->flag |= SOCK_UNAVAIL;
        sock= BLI_findlink(&node->outputs, RRES_OUT_MIST);
        if(!(passflag & SCE_PASS_MIST)) sock->flag |= SOCK_UNAVAIL;
+       sock= BLI_findlink(&node->outputs, RRES_OUT_EMIT);
+       if(!(passflag & SCE_PASS_EMIT)) sock->flag |= SOCK_UNAVAIL;
+       sock= BLI_findlink(&node->outputs, RRES_OUT_ENV);
+       if(!(passflag & SCE_PASS_ENVIRONMENT)) sock->flag |= SOCK_UNAVAIL;
        
 }
 
index 541b3802249cd5f010484e751b52dd8ad596703b..1142bd96dcdc033b1a752578fd90e59401753d73 100644 (file)
@@ -511,10 +511,17 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc
        te->name= "Refraction";
        te->directdata= &srl->passflag;
        
-       te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_RADIO);
-       te->name= "Radiosity";
+       te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_INDIRECT);
+       te->name= "Indirect";
+       te->directdata= &srl->passflag;
+
+       te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_ENVIRONMENT);
+       te->name= "Environment";
+       te->directdata= &srl->passflag;
+
+       te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_EMIT);
+       te->name= "Emit";
        te->directdata= &srl->passflag;
-       
 }
 
 
@@ -4946,7 +4953,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
                                uiButSetFunc(bt, restrictbutton_r_lay_cb, tselem->id, NULL);
                                
                                layflag++;      /* is lay_xor */
-                               if(ELEM6(tselem->nr, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_RADIO))
+                               if(ELEM8(tselem->nr, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_INDIRECT, SCE_PASS_EMIT, SCE_PASS_ENVIRONMENT))
                                        bt= uiDefIconButBitI(block, TOG, tselem->nr, 0, (*layflag & tselem->nr)?ICON_DOT:ICON_BLANK1, 
                                                                         (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (short)te->ys, 17, OL_H-1, layflag, 0, 0, 0, 0, "Exclude this Pass from Combined");
                                uiButSetFunc(bt, restrictbutton_r_lay_cb, tselem->id, NULL);
index c9339b4bdddd26a34264e7de3f840e1dade36889..283408ba853975f9500d973e5441235e4fab24d0 100644 (file)
@@ -183,12 +183,11 @@ typedef struct SceneRenderLayer {
 #define SCE_PASS_REFRACT               1024
 #define SCE_PASS_INDEXOB               2048
 #define SCE_PASS_UV                            4096
-#define SCE_PASS_RADIO                 8192 /* Radio removed, can use for new GI? */
+#define SCE_PASS_INDIRECT              8192
 #define SCE_PASS_MIST                  16384
 #define SCE_PASS_RAYHITS               32768
 #define SCE_PASS_EMIT                  65536
 #define SCE_PASS_ENVIRONMENT   131072
-#define SCE_PASS_INDIRECT              262144
 
 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */
 
index aa3fa9db412756ecf03f7a713be79e5d7b1efa77..a50637023650aca14426ccba1840f4838d49d76d 100644 (file)
@@ -46,9 +46,11 @@ static bNodeSocketType cmp_node_rlayers_out[]= {
        {       SOCK_RGBA, 0, "AO",                     0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_RGBA, 0, "Reflect",        0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_RGBA, 0, "Refract",        0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
-       {       SOCK_RGBA, 0, "Radio",          0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 0, "Indirect",       0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_VALUE, 0, "IndexOB",       0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_VALUE, 0, "Mist",          0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 0, "Emit",           0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 0, "Environment",0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       -1, 0, ""       }
 };
 
@@ -176,13 +178,16 @@ void outputs_multilayer_get(RenderData *rd, RenderLayer *rl, bNodeStack **out, I
                out[RRES_OUT_REFLECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_REFLECT);
        if(out[RRES_OUT_REFRACT]->hasoutput)
                out[RRES_OUT_REFRACT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_REFRACT);
-       if(out[RRES_OUT_RADIO]->hasoutput)
-               out[RRES_OUT_RADIO]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_RADIO);
+       if(out[RRES_OUT_INDIRECT]->hasoutput)
+               out[RRES_OUT_INDIRECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_INDIRECT);
        if(out[RRES_OUT_INDEXOB]->hasoutput)
                out[RRES_OUT_INDEXOB]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_INDEXOB);
        if(out[RRES_OUT_MIST]->hasoutput)
                out[RRES_OUT_MIST]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_MIST);
-       
+       if(out[RRES_OUT_EMIT]->hasoutput)
+               out[RRES_OUT_EMIT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_EMIT);
+       if(out[RRES_OUT_ENV]->hasoutput)
+               out[RRES_OUT_ENV]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_ENVIRONMENT);
 };
 
 
@@ -334,13 +339,16 @@ void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStack **out
       out[RRES_OUT_REFLECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFLECT);
    if(out[RRES_OUT_REFRACT]->hasoutput)
       out[RRES_OUT_REFRACT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFRACT);
-   if(out[RRES_OUT_RADIO]->hasoutput)
-      out[RRES_OUT_RADIO]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_RADIO);
+   if(out[RRES_OUT_INDIRECT]->hasoutput)
+      out[RRES_OUT_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDIRECT);
    if(out[RRES_OUT_INDEXOB]->hasoutput)
           out[RRES_OUT_INDEXOB]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDEXOB);
    if(out[RRES_OUT_MIST]->hasoutput)
           out[RRES_OUT_MIST]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_MIST);
-
+   if(out[RRES_OUT_EMIT]->hasoutput)
+          out[RRES_OUT_EMIT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_EMIT);
+   if(out[RRES_OUT_ENV]->hasoutput)
+          out[RRES_OUT_ENV]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_ENVIRONMENT);
 };
 
 static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
index b049e2484e427313f1684e4bb1b330dbc6db6c2f..e800ce3acf008a041496cb835b443fd8d842f15b 100644 (file)
@@ -368,12 +368,6 @@ static char *get_pass_name(int passtype, int channel)
                if(channel==1) return "Refract.G";
                return "Refract.B";
        }
-       if(passtype == SCE_PASS_RADIO) {
-               if(channel==-1) return "Radio";
-               if(channel==0) return "Radio.R";
-               if(channel==1) return "Radio.G";
-               return "Radio.B";
-       }
        if(passtype == SCE_PASS_INDEXOB) {
                if(channel==-1) return "IndexOB";
                return "IndexOB.X";
@@ -440,9 +434,6 @@ static int passtype_from_name(char *str)
        if(strcmp(str, "Refract")==0)
                return SCE_PASS_REFRACT;
 
-       if(strcmp(str, "Radio")==0)
-               return SCE_PASS_RADIO;
-
        if(strcmp(str, "IndexOB")==0)
                return SCE_PASS_INDEXOB;
 
@@ -622,8 +613,6 @@ static RenderResult *new_render_result(Render *re, rcti *partrct, int crop, int
                        render_layer_add_pass(rr, rl, 3, SCE_PASS_REFLECT);
                if(srl->passflag  & SCE_PASS_REFRACT)
                        render_layer_add_pass(rr, rl, 3, SCE_PASS_REFRACT);
-               if(srl->passflag  & SCE_PASS_RADIO)
-                       render_layer_add_pass(rr, rl, 3, SCE_PASS_RADIO);
                if(srl->passflag  & SCE_PASS_INDEXOB)
                        render_layer_add_pass(rr, rl, 1, SCE_PASS_INDEXOB);
                if(srl->passflag  & SCE_PASS_MIST)
index 52dee6ba9545dfeea30f587dca277cdd525f26d7..85c96d17ac0ca6358b7617edbf35204ed2d34439 100644 (file)
@@ -486,9 +486,6 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
                        case SCE_PASS_REFRACT:
                                col= shr->refr;
                                break;
-                       case SCE_PASS_RADIO:
-                               col= NULL; // removed shr->rad;
-                               break;
                        case SCE_PASS_NORMAL:
                                col= shr->nor;
                                break;
@@ -593,9 +590,6 @@ static void add_passes(RenderLayer *rl, int offset, ShadeInput *shi, ShadeResult
                        case SCE_PASS_REFRACT:
                                col= shr->refr;
                                break;
-                       case SCE_PASS_RADIO:
-                               col= NULL; // removed shr->rad;
-                               break;
                        case SCE_PASS_NORMAL:
                                col= shr->nor;
                                break;
index 60d003f3c2139d1a4ad42a92883a3896184edb2d..b80abe1e528aabc270837cce0c4c446b22fa26eb 100644 (file)
@@ -176,7 +176,7 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
        }
        
        /* copy additional passes */
-       if(shi->passflag & (SCE_PASS_VECTOR|SCE_PASS_NORMAL|SCE_PASS_RADIO)) {
+       if(shi->passflag & (SCE_PASS_VECTOR|SCE_PASS_NORMAL)) {
                QUATCOPY(shr->winspeed, shi->winspeed);
                VECCOPY(shr->nor, shi->vn);
        }
index f7e2861f124e4f04449542d1bf6ebd225f4366fc..c754ed1eab95f5068861ecc16c8783e5a8f9bd8a 100644 (file)
@@ -240,8 +240,6 @@ void interpolate_shade_result(ShadeResult *shr1, ShadeResult *shr2, float t, Sha
                        interpolate_vec3(shr1->refl, shr2->refl, t, negt, shr->refl);
                if(addpassflag & SCE_PASS_REFRACT)
                        interpolate_vec3(shr1->refr, shr2->refr, t, negt, shr->refr);
-               /* removed if(addpassflag & SCE_PASS_RADIO)
-                       interpolate_vec3(shr1->rad, shr2->rad, t, negt, shr->rad);*/
                if(addpassflag & SCE_PASS_MIST)
                        interpolate_vec1(&shr1->mist, &shr2->mist, t, negt, &shr->mist);
        }
index dc87170842bd908c8779dcfcde8a11ae433e4d42..93e6f7a234a67b90263e17ad83c5a4ee3bab704a 100644 (file)
@@ -3539,9 +3539,6 @@ void merge_transp_passes(RenderLayer *rl, ShadeResult *shr)
                        case SCE_PASS_REFLECT:
                                col= shr->refl;
                                break;
-                       case SCE_PASS_RADIO:
-                               col= NULL; // removed shr->rad;
-                               break;
                        case SCE_PASS_REFRACT:
                                col= shr->refr;
                                break;
@@ -3650,9 +3647,6 @@ void add_transp_passes(RenderLayer *rl, int offset, ShadeResult *shr, float alph
                        case SCE_PASS_REFRACT:
                                col= shr->refr;
                                break;
-                       case SCE_PASS_RADIO:
-                               col= NULL; // removed shr->rad;
-                               break;
                        case SCE_PASS_NORMAL:
                                col= shr->nor;
                                break;
@@ -3900,9 +3894,6 @@ static int addtosamp_shr(ShadeResult *samp_shr, ShadeSample *ssamp, int addpassf
                                        if(addpassflag & SCE_PASS_REFRACT)
                                                addvecmul(samp_shr->refr, shr->refr, fac);
                                        
-                                       /* removed if(addpassflag & SCE_PASS_RADIO)
-                                               addvecmul(samp_shr->rad, shr->rad, fac);*/
-                                       
                                        if(addpassflag & SCE_PASS_MIST)
                                                samp_shr->mist= samp_shr->mist+fac*shr->mist;