[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13691] trunk/blender/source/blender: 1) Revert previous commit, rendering negative won't work that simple...

Ton Roosendaal ton at blender.org
Thu Feb 14 19:56:14 CET 2008


Revision: 13691
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13691
Author:   ton
Date:     2008-02-14 19:56:14 +0100 (Thu, 14 Feb 2008)

Log Message:
-----------
1) Revert previous commit, rendering negative won't work that simple...
   Needs much more attention.
2) Fix for zcombine node: 
   - it skipped execution when no image rgba out was used
   - didnt work for FSA yet

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_scene_types.h
    trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c
    trunk/blender/source/blender/render/intern/source/shadeoutput.c

Modified: trunk/blender/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_scene_types.h	2008-02-14 18:00:58 UTC (rev 13690)
+++ trunk/blender/source/blender/makesdna/DNA_scene_types.h	2008-02-14 18:56:14 UTC (rev 13691)
@@ -306,6 +306,19 @@
 	float simplify_aosss;
 } RenderData;
 
+/* control render convert and shading engine */
+typedef struct RenderProfile {
+	struct RenderProfile *next, *prev;
+	char name[32];
+	
+	short particle_perc;
+	short subsurf_max;
+	short shadbufsample_max;
+	short pad1;
+	
+	float ao_error, pad2;
+	
+} RenderProfile;
 
 typedef struct GameFraming {
 	float col[3];
@@ -330,7 +343,7 @@
 } ImagePaintSettings;
 
 typedef struct ParticleBrushData {
-	short size, strength;	/* commong settings */
+	short size, strength;	/* common settings */
 	short step, invert;		/* for specific brushes only */
 } ParticleBrushData;
 

Modified: trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c
===================================================================
--- trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c	2008-02-14 18:00:58 UTC (rev 13690)
+++ trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c	2008-02-14 18:56:14 UTC (rev 13691)
@@ -52,6 +52,9 @@
 	}
 	else {
 		QUATCOPY(out, src2);
+		
+		if(node->custom1)
+			*z1= *z2;
 	}
 }
 
@@ -78,54 +81,57 @@
 static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
 {
 	RenderData *rd= data;
-	
+	CompBuf *cbuf= in[0]->data;
+	CompBuf *zbuf;
+
 	/* stack order in: col z col z */
 	/* stack order out: col z */
-	if(out[0]->hasoutput==0) 
+	if(out[0]->hasoutput==0 && out[1]->hasoutput==0) 
 		return;
 	
 	/* no input image; do nothing now */
 	if(in[0]->data==NULL) {
 		return;
 	}
-	else if(rd->scemode & R_FULL_SAMPLE) {
+	
+	if(out[1]->hasoutput) {
+		/* copy or make a buffer for for the first z value, here we write result in */
+		if(in[1]->data)
+			zbuf= dupalloc_compbuf(in[1]->data);
+		else {
+			float *zval;
+			int tot= cbuf->x*cbuf->y;
+			
+			zbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
+			for(zval= zbuf->rect; tot; tot--, zval++)
+				*zval= in[1]->vec[0];
+		}
+		/* lazy coder hack */
+		node->custom1= 1;
+		out[1]->data= zbuf;
+	}
+	else {
+		node->custom1= 0;
+		zbuf= in[1]->data;
+	}
+	
+	if(rd->scemode & R_FULL_SAMPLE) {
 		/* make output size of first input image */
-		CompBuf *cbuf= in[0]->data;
 		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); // allocs
 		
-		composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, 
+		composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, zbuf, in[1]->vec, in[2]->data, in[2]->vec, 
 								  in[3]->data, in[3]->vec, do_zcombine, CB_RGBA, CB_VAL, CB_RGBA, CB_VAL);
 		
 		out[0]->data= stackbuf;
 	}
 	else {
 		/* make output size of first input image */
-		CompBuf *cbuf= in[0]->data;
 		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-		CompBuf *zbuf, *mbuf;
+		CompBuf *mbuf;
 		float *fp;
 		int x;
 		char *aabuf;
 		
-		if(out[1]->hasoutput) {
-			/* copy or make a buffer for for the first z value, here we write result in */
-			if(in[1]->data)
-				zbuf= dupalloc_compbuf(in[1]->data);
-			else {
-				float *zval;
-				int tot= cbuf->x*cbuf->y;
-				
-				zbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
-				for(zval= zbuf->rect; tot; tot--, zval++)
-					*zval= in[1]->vec[0];
-			}
-			/* lazy coder hack */
-			node->custom1= 1;
-		}
-		else {
-			node->custom1= 0;
-			zbuf= in[1]->data;
-		}
 		
 		/* make a mask based on comparison, optionally write zvalue */
 		mbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
@@ -153,9 +159,8 @@
 		MEM_freeN(aabuf);
 		
 		out[0]->data= stackbuf;
-		if(node->custom1)
-			out[1]->data= zbuf;
 	}
+
 }
 
 bNodeType cmp_node_zcombine= {

Modified: trunk/blender/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/shadeoutput.c	2008-02-14 18:00:58 UTC (rev 13690)
+++ trunk/blender/source/blender/render/intern/source/shadeoutput.c	2008-02-14 18:56:14 UTC (rev 13691)
@@ -1516,25 +1516,10 @@
 /* let's map negative light as if it mirrors positive light, otherwise negative values disappear */
 static void wrld_exposure_correct(float *diff)
 {
-	float f= diff[0];
 	
-	if(f>0.0f)
-		diff[0]= R.wrld.linfac*(1.0f-exp( f*R.wrld.logfac) );
-	else
-		diff[0]= - R.wrld.linfac*(1.0f-exp( - f*R.wrld.logfac) );
-	
-	f= diff[1];
-	if(f>0.0f)
-		diff[1]= R.wrld.linfac*(1.0f-exp( f*R.wrld.logfac) );
-	else
-		diff[1]= - R.wrld.linfac*(1.0f-exp( - f*R.wrld.logfac) );
-	
-	f= diff[2];
-	if(f>0.0f)
-		diff[2]= R.wrld.linfac*(1.0f-exp( f*R.wrld.logfac) );
-	else
-		diff[2]= - R.wrld.linfac*(1.0f-exp( - f*R.wrld.logfac) );
-	
+	diff[0]= R.wrld.linfac*(1.0f-exp( diff[0]*R.wrld.logfac) );
+	diff[1]= R.wrld.linfac*(1.0f-exp( diff[1]*R.wrld.logfac) );
+	diff[2]= R.wrld.linfac*(1.0f-exp( diff[2]*R.wrld.logfac) );
 }
 
 void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)





More information about the Bf-blender-cvs mailing list