I hoped we could skip a floor() in the new zbuffer code, but no...
authorTon Roosendaal <ton@blender.org>
Wed, 23 Nov 2005 17:38:05 +0000 (17:38 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 23 Nov 2005 17:38:05 +0000 (17:38 +0000)
rounding negative values goes to zero, caused left pixel to not
render in images.

source/blender/render/intern/source/zbuf.c

index 4c46bf2826ac8ecf732ce3dc3511187dd21f8d04..298a86b6f766e1237df79cdcc9f5342e58c7f06a 100644 (file)
@@ -654,8 +654,8 @@ static void zbufinvulAc4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v
        
        for(y=my2; y>=my0; y--, span1--, span2--) {
                
        
        for(y=my2; y>=my0; y--, span1--, span2--) {
                
-               sn1= (int)*span1;
-               sn2= (int)*span2;
+               sn1= floor(*span1);
+               sn2= floor(*span2);
                sn1++; 
                
                if(sn2>=rectx) sn2= rectx-1;
                sn1++; 
                
                if(sn2>=rectx) sn2= rectx-1;
@@ -1571,8 +1571,8 @@ static void zbufinvulGL4(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v
        
        for(y=my2; y>=my0; y--, span1--, span2--) {
                
        
        for(y=my2; y>=my0; y--, span1--, span2--) {
                
-               sn1= (int)*span1;
-               sn2= (int)*span2;
+               sn1= floor(*span1);
+               sn2= floor(*span2);
                sn1++; 
                
                if(sn2>=rectx) sn2= rectx-1;
                sn1++; 
                
                if(sn2>=rectx) sn2= rectx-1;
@@ -1667,8 +1667,8 @@ static void zbufinvulGL(ZSpan *zspan, int zvlnr, float *v1, float *v2, float *v3
        
        for(y=my2; y>=my0; y--, span1--, span2--) {
                
        
        for(y=my2; y>=my0; y--, span1--, span2--) {
                
-               sn1= (int)*span1;
-               sn2= (int)*span2;
+               sn1= floor(*span1);
+               sn2= floor(*span2);
                
                sn1++; 
                
                
                sn1++;