Fix T40507: Blender Internal Render's Gather don't use node's emit color.
authorBastien Montagne <montagne29@wanadoo.fr>
Sat, 6 Sep 2014 20:50:31 +0000 (22:50 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Sat, 6 Sep 2014 20:50:31 +0000 (22:50 +0200)
Node was simply ignored by occ shading (noted as TODO), though it's a mere matter
of a very few lines of code, nowadays... Just copied from similar task in bake code.

source/blender/render/intern/source/occlusion.c

index f0fe5d054f06bc008e5a24f6185f74d6fcac1f37..0c6341fe9e5eeb9775f0c8d1710aeb1de37bb353 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "BLF_translation.h"
 
+#include "BKE_node.h"
 #include "BKE_scene.h"
 
 
@@ -194,14 +195,19 @@ static void occ_shade(ShadeSample *ssamp, ObjectInstanceRen *obi, VlakRen *vlr,
        }
 
        /* init material vars */
-       /* note, keep this synced with render_types.h */
-       memcpy(&shi->r, &shi->mat->r, 23 * sizeof(float));
-       shi->har = shi->mat->har;
-       
+       shade_input_init_material(shi);
+
        /* render */
        shade_input_set_shade_texco(shi);
-       shade_material_loop(shi, shr); /* todo: nodes */
-       
+
+       if (shi->mat->nodetree && shi->mat->use_nodes) {
+               ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
+               shi->mat = vlr->mat;  /* shi->mat is being set in nodetree */
+       }
+       else {
+               shade_material_loop(shi, shr);
+       }
+
        copy_v3_v3(rad, shr->combined);
 }