svn merge -r 16866:17042 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender-staging.git] / source / blender / render / intern / source / rayshade.c
index f822d41bb85c11b11fea21cf0a294cd3f6b8061a..c431340d770a229b37b847a8eb8e3dd533ded6f1 100644 (file)
@@ -205,7 +205,7 @@ void makeraytree(Render *re)
        re->stats_draw(&re->i);
 }
 
-static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
+void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
 {
        VlakRen *vlr= (VlakRen*)is->face;
        ObjectInstanceRen *obi= RAY_OBJECT_GET(&R, is->ob);
@@ -274,9 +274,10 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
                        ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
                        shi->mat= vlr->mat;             /* shi->mat is being set in nodetree */
                }
-               else
-                       shade_material_loop(shi, shr);
-               
+               else {
+                       if (shi->mat->material_type == MA_SOLID) shade_material_loop(shi, shr);
+                       else if (shi->mat->material_type == MA_VOLUME) shade_volume_loop(shi, shr);
+               }
                /* raytrace likes to separate the spec color */
                VECSUB(shr->diff, shr->combined, shr->spec);
        }