Revision: 15823
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15823
Author:   joeedh
Date:     2008-07-27 23:14:18 +0200 (Sun, 27 Jul 2008)

Log Message:
-----------
more strand improvements

Modified Paths:
--------------
    branches/soc-2007-joeedh/source/blender/render/intern/include/render_types.h
    
branches/soc-2007-joeedh/source/blender/render/intern/source/convertblender.c
    branches/soc-2007-joeedh/source/blender/render/intern/source/dsm.c
    branches/soc-2007-joeedh/source/blender/render/intern/source/zbuf.c

Modified: 
branches/soc-2007-joeedh/source/blender/render/intern/include/render_types.h
===================================================================
--- 
branches/soc-2007-joeedh/source/blender/render/intern/include/render_types.h    
    2008-07-27 20:31:38 UTC (rev 15822)
+++ 
branches/soc-2007-joeedh/source/blender/render/intern/include/render_types.h    
    2008-07-27 21:14:18 UTC (rev 15823)
@@ -388,7 +388,8 @@
        int flag, maxdepth;
        float adaptcos, minwidth, widthfade;
 
-       float winmat[4][4];
+       float (*winmat)[4];
+       float stored_winmat[4][4];
        int winx, winy;
 } StrandBuffer;
 

Modified: 
branches/soc-2007-joeedh/source/blender/render/intern/source/convertblender.c
===================================================================
--- 
branches/soc-2007-joeedh/source/blender/render/intern/source/convertblender.c   
    2008-07-27 20:31:38 UTC (rev 15822)
+++ 
branches/soc-2007-joeedh/source/blender/render/intern/source/convertblender.c   
    2008-07-27 21:14:18 UTC (rev 15823)
@@ -1708,7 +1708,8 @@
                                strandbuf= RE_addStrandBuffer(obr, 
(totpart+totchild)*(path_nbr+1));
                                strandbuf->ma= ma;
                                strandbuf->lay= ob->lay;
-                               Mat4CpyMat4(strandbuf->winmat, re->winmat);
+                               Mat4CpyMat4(strandbuf->stored_winmat, 
re->winmat);
+                               strandbuf->winmat = strandbuf->stored_winmat;
                                strandbuf->winx= re->winx;
                                strandbuf->winy= re->winy;
                                strandbuf->maxdepth= 2;

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-27 20:31:38 UTC (rev 15822)
+++ branches/soc-2007-joeedh/source/blender/render/intern/source/dsm.c  
2008-07-27 21:14:18 UTC (rev 15823)
@@ -317,7 +317,7 @@
                }
        }
 
-       printf("maxsamples: %d %d %d\n", maxsamples[0], maxsamples[1], 
maxsamples[2]);
+       //printf("maxsamples: %d %d %d\n", maxsamples[0], maxsamples[1], 
maxsamples[2]);
 
        for (x=0; x<buf->sizex; x++) {
                for (y=0; y<buf->sizey; y++) {

Modified: branches/soc-2007-joeedh/source/blender/render/intern/source/zbuf.c
===================================================================
--- branches/soc-2007-joeedh/source/blender/render/intern/source/zbuf.c 
2008-07-27 20:31:38 UTC (rev 15822)
+++ branches/soc-2007-joeedh/source/blender/render/intern/source/zbuf.c 
2008-07-27 21:14:18 UTC (rev 15823)
@@ -3808,8 +3808,8 @@
                                        maxx /= tilesizex; maxy /= tilesizey;
 
                                        //printf("bounds: [%f, %f, %f, %f]\n", 
minx, miny, maxx, maxy);
-                                       for (x=minx; x<maxx; x++) {
-                                               for (y=miny; y<maxy; y++) {
+                                       for (x=minx; x<=maxx; x++) {
+                                               for (y=miny; y<=maxy; y++) {
                                                        tile = 
TCS_GetAndLockTile((TCS_TileBuffer*)bucketbuf, x, y, 0);
                                                        BUCKET_ADD(tile, 
(tile->ventries), (tile->lastv), zvlnr, i, (tile->totv));
                                                        TCS_UnlockTile(tile);
@@ -3882,11 +3882,18 @@
                                if (sminy < 0) sminy = 0;
                                if (smaxx >= rectx) smaxx = rectx-1;
                                if (smaxy >= recty) smaxy = recty-1;
+
+                               if (G.rt == 98) {
+                                       sminx = sminy = 0;
+                                       smaxx = rectx-1;
+                                       smaxy = recty-1;
+                               }
+
                                sminx /= tilesizex; sminy /= tilesizey;
                                smaxx /= tilesizex; smaxy /= tilesizey;
                                
-                               for (x=sminx; x<smaxx; x++) {
-                                       for (y=sminy; y<smaxy; y++) {
+                               for (x=sminx; x<=smaxx; x++) {
+                                       for (y=sminy; y<=smaxy; y++) {
                                                tile = 
TCS_GetAndLockTile((TCS_TileBuffer*)bucketbuf, x, y, 0);
                                                BUCKET_ADD(tile, 
(tile->sentries), (tile->lasts), strand->index, i, (tile->tots));
                                                TCS_UnlockTile(tile);
@@ -3921,7 +3928,7 @@
        VertRen *v1, *v2, *v3, *v4;
        float vec[3], hoco[4], mul, zval, fval;
        float bounds[4], ho1[4], ho2[4], ho3[4], ho4[4]={0};
-       int b=0, i, zvlnr, c1, c2, c3, c4=0, dofill= 0;
+       int b=0, i, zvlnr, c1, c2, c3, c4=0, dofill= 0, oldwinx, oldwiny;
        int zsample, samples, polygon_offset, *arectz;
        RE_BucketEntry *entry;
 
@@ -4141,6 +4148,12 @@
                                        sseg.v[3]= (b < strand->totvert-2)? 
svert+2: svert+1;
                                        sseg.shaded = 0;
 
+                                       oldwinx = strand->buffer->winx;
+                                       oldwiny = strand->buffer->winy;
+                                       strand->buffer->winx = re->winx;
+                                       strand->buffer->winy = re->winy;
+                                       strand->buffer->winmat = re->winmat;
+
                                        c1= zbuf_part_project(cache, 
sseg.v[0]-strand->vert, obwinmat, bounds, sseg.v[0]->co, ho1);
                                        c2= zbuf_part_project(cache, 
sseg.v[1]-strand->vert, obwinmat, bounds, sseg.v[1]->co, ho2);
                                        c3= zbuf_part_project(cache, 
sseg.v[2]-strand->vert, obwinmat, bounds, sseg.v[2]->co, ho3);
@@ -4155,6 +4168,9 @@
                                                }
                                                render_strand_segment(re, 
winmat, &spart, zspans, samples, &sseg);      
                                        }
+                                       strand->buffer->winx = oldwinx;
+                                       strand->buffer->winy = oldwiny;
+                                       strand->buffer->winmat = 
strand->buffer->stored_winmat;
                                }
                        }
 


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

Reply via email to