Revision: 15641
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15641
Author:   joeedh
Date:     2008-07-19 14:34:19 +0200 (Sat, 19 Jul 2008)

Log Message:
-----------
pre-merge commit

Modified Paths:
--------------
    branches/soc-2007-joeedh/source/blender/blenkernel/BKE_dsm.h
    branches/soc-2007-joeedh/source/blender/render/intern/source/dsm.c

Modified: branches/soc-2007-joeedh/source/blender/blenkernel/BKE_dsm.h
===================================================================
--- branches/soc-2007-joeedh/source/blender/blenkernel/BKE_dsm.h        
2008-07-19 10:27:52 UTC (rev 15640)
+++ branches/soc-2007-joeedh/source/blender/blenkernel/BKE_dsm.h        
2008-07-19 12:34:19 UTC (rev 15641)
@@ -105,7 +105,7 @@
 
 #define DSM_SAMPLEMERGE_LIMIT  (0x7FFFFFFF) //20000000
 
-#define DSM_LINEAR     0
+#define DSM_LINEAR     1
 #define DSM_SOFT       0
 //#define DOQMCDEBUG
 

Modified: branches/soc-2007-joeedh/source/blender/render/intern/source/dsm.c
===================================================================
--- branches/soc-2007-joeedh/source/blender/render/intern/source/dsm.c  
2008-07-19 10:27:52 UTC (rev 15640)
+++ branches/soc-2007-joeedh/source/blender/render/intern/source/dsm.c  
2008-07-19 12:34:19 UTC (rev 15641)
@@ -1305,6 +1305,23 @@
        return totface;
 }
 
+/* color 'shadfac' passes through 'col' with alpha and filter */
+/* filter is only applied on alpha defined transparent part */
+static void addAlphaLight(float *shadfac, float *col, float alpha, float 
filter)
+{
+       float fr, fg, fb;
+       
+       fr= 1.0f+ filter*(col[0]-1.0f);
+       fg= 1.0f+ filter*(col[1]-1.0f);
+       fb= 1.0f+ filter*(col[2]-1.0f);
+       
+       shadfac[0]= alpha*col[0] + fr*(1.0f-alpha)*shadfac[0];
+       shadfac[1]= alpha*col[1] + fg*(1.0f-alpha)*shadfac[1];
+       shadfac[2]= alpha*col[2] + fb*(1.0f-alpha)*shadfac[2];
+       
+       shadfac[3]= (1.0f-alpha)*shadfac[3];
+}
+
 /*cindex is component index, since all transmittance functions for r, g, and b
   are squased into only one input stream.*/
 DSMFunction *DSM_MergeLayerListNoWeight(MemArena *arena, _ClrEntry *row, 
ListBase (*transfuncs)[3], 
@@ -1687,7 +1704,9 @@
                                                          transparent, they do 
not produce colored shadows.
                                                          
                                                          to deal with this, we 
produce a grayscale color equal to
-                                                         the shadowalpha, when 
shadowalpha is not 1.0.*/
+                                                         the shadowalpha, when 
shadowalpha is not 1.0.
+                                                         
+                                                         WARNING: HACK!*/
                                                        
                                                        /*this stuff taken from 
rayshade.c code*/
                                                        if (!ELEM(row[a].type, 
DSM_FACE_STEP, DSM_STRAND_STEP)) {
@@ -1695,10 +1714,21 @@
                                                                        
accum[row[a].samplenr][b] *= (1.0f - mat->shad_alpha);
                                                                } else {
                                                                        fac= 
1.0f + mat->filter*(clr[b]-1.0f);
-                                                                       fac = 
clr[3]*clr[b] + fac*(1.0f-clr[3])*accum[row[a].samplenr][b];
-                                                                       
accum[row[a].samplenr][b] *= (1.0f - clr[3])*fac;
+                                                                       //fac = 
clr[3]*clr[b] + fac*(1.0f-clr[3])*accum[row[a].samplenr][b];
+                                                                       fac = 
clr[3]*clr[b] + fac*(1.0f-clr[3]);
+                                                                       
accum[row[a].samplenr][b] *= (1.0f-clr[3])*fac;
+                                                                       //
+                                                                       
//accum[row[a].samplenr][b] *= 1.0f - clr[3];
+                                                                       
//accum[row[a].samplenr][b] *= 1.0 - (1.0 - clr[3])*clr[b];
+                                                                       
//accum[row[a].samplenr][b] *= 1.0 - clr[3]*(1.0 - clr[b]);
+
+                                                                       
//addAlphaLight(accum[row[a].samplenr][b], clr, clr[3], mat->filter);
                                                                }
-                                                       }
+                                                       }/* not needed I think, 
since accum should already
+                                                           have the previous 
value it needs.
+                                                        else {
+                                                               
accum[row[a].samplenr][b] = row[a].prev->value;
+                                                       }*/
 
                                                        row[a].value = 
accum[row[a].samplenr][b];
 
@@ -2569,11 +2599,6 @@
        co[3]= 1.0f;
        MTC_Mat4MulVec4fl(shb->persmat, co); /* rational hom co */
        
-       /*MTC_Mat4MulVecfl(shb->viewmat, co);
-       co[3]= 1.0f;
-       MTC_Mat4MulVec4fl(shb->winmat, co);     // rational hom co
-       */
-
        xs= siz*(1.0f+co[0]/co[3]);
        ys= siz*(1.0f+co[1]/co[3]);
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to