svn merge -r 22571:22800 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender-staging.git] / source / blender / render / intern / source / shadeinput.c
index 7541ce530739eba2d58957e502e2c364eac4ae1b..0d3c5772d8ad0e593ed991b1db9645514042427a 100644 (file)
@@ -44,6 +44,7 @@
 #include "BKE_node.h"
 
 /* local include */
+#include "raycounter.h"
 #include "renderpipeline.h"
 #include "render_types.h"
 #include "renderdatabase.h"
@@ -181,6 +182,9 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
        float alpha;
        
        /* ------  main shading loop -------- */
+#ifdef RE_RAYCOUNTER
+       memset(&shi->raycounter, 0, sizeof(shi->raycounter));
+#endif
        
        if(shi->mat->nodetree && shi->mat->use_nodes) {
                ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
@@ -230,6 +234,18 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
        
        /* add z */
        shr->z= -shi->co[2];
+       
+       /* RAYHITS */
+/*
+       if(1 || shi->passflag & SCE_PASS_RAYHITS)
+       {
+               shr->rayhits[0] = (float)shi->raycounter.faces.test;
+               shr->rayhits[1] = (float)shi->raycounter.bb.hit;
+               shr->rayhits[2] = 0.0;
+               shr->rayhits[3] = 1.0;
+               RE_RC_MERGE(&re_rc_counter[shi->thread], &shi->raycounter);
+       }
+ */
 }
 
 /* **************************************************************************** */