Merged changes in the trunk up to revision 26856.
[blender-staging.git] / source / blender / render / intern / source / pipeline.c
index c5d4392a53c797d2c7a5d1458a56b71d9d532f24..72b147e992762f21d71feac1d6a16cf23d373abc 100644 (file)
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  * The Original Code is Copyright (C) 2006 Blender Foundation.
  * All rights reserved.
@@ -67,6 +67,9 @@
 
 #include "RE_pipeline.h"
 
+#include "FRS_freestyle.h"
+#include "FRS_freestyle_config.h"
+
 /* internal */
 #include "render_types.h"
 #include "renderpipeline.h"
@@ -654,6 +657,7 @@ static RenderResult *new_render_result(Render *re, rcti *partrct, int crop, int
                rl->lay= (1<<20) -1;
                rl->layflag= 0x7FFF;    /* solid ztra halo strand */
                rl->passflag= SCE_PASS_COMBINED;
+               FRS_add_freestyle_config( srl );
                
                re->r.actlay= 0;
        }
@@ -1871,6 +1875,10 @@ static void do_render_3d(Render *re)
                if(!re->test_break(re->tbh))
                        add_halo_flare(re);
        
+       /* Freestyle  */
+       if( re->r.mode & R_EDGE_FRS && re->r.renderer==R_INTERN)
+               FRS_add_Freestyle(re);
+               
        /* free all render verts etc */
        RE_Database_Free(re);
 }
@@ -2369,6 +2377,7 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
                        float *col= rres.rectf + 4*y*re->rectx;
                                
                        for(x=0; x<re->rectx; x++, rf+=4, col+=4) {
+                               /* clamping to 1.0 is needed for correct AA */
                                if(col[0]<0.0f) col[0]=0.0f; else if(col[0] > 1.0f) col[0]= 1.0f;
                                if(col[1]<0.0f) col[1]=0.0f; else if(col[1] > 1.0f) col[1]= 1.0f;
                                if(col[2]<0.0f) col[2]=0.0f; else if(col[2] > 1.0f) col[2]= 1.0f;