[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30909] branches/render25: Render Branch: code tweak, revert splitting up of ShadeInput, didn't work out

Brecht Van Lommel brecht at blender.org
Fri Jul 30 19:18:16 CEST 2010


Revision: 30909
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30909
Author:   blendix
Date:     2010-07-30 19:18:16 +0200 (Fri, 30 Jul 2010)

Log Message:
-----------
Render Branch: code tweak, revert splitting up of ShadeInput, didn't work out
well and ended up mostly being confusing.

Modified Paths:
--------------
    branches/render25/release/scripts/ui/properties_render.py
    branches/render25/source/blender/blenkernel/intern/displist.c
    branches/render25/source/blender/makesdna/DNA_scene_types.h
    branches/render25/source/blender/makesrna/intern/rna_scene.c
    branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_camera.c
    branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_geom.c
    branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_material.c
    branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_output.c
    branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_texture.c
    branches/render25/source/blender/nodes/intern/SHD_util.c
    branches/render25/source/blender/render/extern/include/RE_shader_ext.h
    branches/render25/source/blender/render/intern/include/material.h
    branches/render25/source/blender/render/intern/source/bake.c
    branches/render25/source/blender/render/intern/source/cache.c
    branches/render25/source/blender/render/intern/source/diskocclusion.c
    branches/render25/source/blender/render/intern/source/halo.c
    branches/render25/source/blender/render/intern/source/lamp.c
    branches/render25/source/blender/render/intern/source/material.c
    branches/render25/source/blender/render/intern/source/object_displace.c
    branches/render25/source/blender/render/intern/source/object_mesh.c
    branches/render25/source/blender/render/intern/source/object_strand.c
    branches/render25/source/blender/render/intern/source/path.c
    branches/render25/source/blender/render/intern/source/pixelfilter.c
    branches/render25/source/blender/render/intern/source/rayshade.c
    branches/render25/source/blender/render/intern/source/rendercore.c
    branches/render25/source/blender/render/intern/source/result.c
    branches/render25/source/blender/render/intern/source/shadeinput.c
    branches/render25/source/blender/render/intern/source/shadeoutput.c
    branches/render25/source/blender/render/intern/source/shadowbuf.c
    branches/render25/source/blender/render/intern/source/texture_stack.c
    branches/render25/source/blender/render/intern/source/volume_precache.c
    branches/render25/source/blender/render/intern/source/volumetric.c

Modified: branches/render25/release/scripts/ui/properties_render.py
===================================================================
--- branches/render25/release/scripts/ui/properties_render.py	2010-07-30 16:15:56 UTC (rev 30908)
+++ branches/render25/release/scripts/ui/properties_render.py	2010-07-30 17:18:16 UTC (rev 30909)
@@ -204,7 +204,6 @@
         if wide_ui:
             col = split.column()
         col.prop(rd, "use_raytracing")
-        col.prop(rd, "use_raytrace_all")
         col.prop(rd, "color_management")
         col.prop(rd, "alpha_mode", text="Alpha")
 

Modified: branches/render25/source/blender/blenkernel/intern/displist.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/displist.c	2010-07-30 16:15:56 UTC (rev 30908)
+++ branches/render25/source/blender/blenkernel/intern/displist.c	2010-07-30 17:18:16 UTC (rev 30909)
@@ -282,11 +282,11 @@
 {
 	memset(&shi, 0, sizeof(ShadeInput));
 
-	shi.geometry.view[2]= -1.0f;
+	shi.view[2]= -1.0f;
 
-	shi.shading.lay= RE_GetScene(re)->lay;
-	shi.shading.passflag= SCE_PASS_COMBINED;
-	shi.shading.combinedflag= -1;
+	shi.lay= RE_GetScene(re)->lay;
+	shi.passflag= SCE_PASS_COMBINED;
+	shi.combinedflag= -1;
 }
 
 static Render *fastshade_get_render(Scene *scene)
@@ -335,87 +335,83 @@
 	MTFace *mtface;
 	int index, n, needuv= ma->texco & TEXCO_UV;
 	char *vertcol;
-	ShadeTexco *tex= &shi.texture;
-	ShadeMaterial *mat= &shi.material;
 
-	tex->totuv= 0;
-	tex->totcol= 0;
+	shi.totuv= 0;
+	shi.totcol= 0;
 
 	for(index=0; index<fdata->totlayer; index++) {
 		layer= &fdata->layers[index];
 		
-		if(needuv && layer->type == CD_MTFACE && tex->totuv < MAX_MTFACE) {
-			n= fastshade_customdata_layer_num(tex->totuv, layer->active_rnd);
+		if(needuv && layer->type == CD_MTFACE && shi.totuv < MAX_MTFACE) {
+			n= fastshade_customdata_layer_num(shi.totuv, layer->active_rnd);
 			mtface= &((MTFace*)layer->data)[a];
 
-			tex->uv[tex->totuv].uv[0]= 2.0f*mtface->uv[j][0]-1.0f;
-			tex->uv[tex->totuv].uv[1]= 2.0f*mtface->uv[j][1]-1.0f;
-			tex->uv[tex->totuv].uv[2]= 1.0f;
+			shi.uv[shi.totuv].uv[0]= 2.0f*mtface->uv[j][0]-1.0f;
+			shi.uv[shi.totuv].uv[1]= 2.0f*mtface->uv[j][1]-1.0f;
+			shi.uv[shi.totuv].uv[2]= 1.0f;
 
-			tex->uv[tex->totuv].name= layer->name;
-			tex->totuv++;
+			shi.uv[shi.totuv].name= layer->name;
+			shi.totuv++;
 		}
-		else if(layer->type == CD_MCOL && tex->totcol < MAX_MCOL) {
-			n= fastshade_customdata_layer_num(tex->totcol, layer->active_rnd);
+		else if(layer->type == CD_MCOL && shi.totcol < MAX_MCOL) {
+			n= fastshade_customdata_layer_num(shi.totcol, layer->active_rnd);
 			vertcol= (char*)&((MCol*)layer->data)[a*4 + j];
 
-			tex->col[tex->totcol].col[0]= ((float)vertcol[3])/255.0f;
-			tex->col[tex->totcol].col[1]= ((float)vertcol[2])/255.0f;
-			tex->col[tex->totcol].col[2]= ((float)vertcol[1])/255.0f;
+			shi.col[shi.totcol].col[0]= ((float)vertcol[3])/255.0f;
+			shi.col[shi.totcol].col[1]= ((float)vertcol[2])/255.0f;
+			shi.col[shi.totcol].col[2]= ((float)vertcol[1])/255.0f;
 
-			tex->col[tex->totcol].name= layer->name;
-			tex->totcol++;
+			shi.col[shi.totcol].name= layer->name;
+			shi.totcol++;
 		}
 	}
 
-	if(needuv && tex->totuv == 0)
-		VECCOPY(tex->uv[0].uv, tex->lo);
+	if(needuv && shi.totuv == 0)
+		VECCOPY(shi.uv[0].uv, shi.lo);
 
-	if(tex->totcol)
-		VECCOPY(mat->vcol, tex->col[0].col);
+	if(shi.totcol)
+		VECCOPY(shi.vcol, shi.col[0].col);
 }
 
 static void fastshade(float *co, float *nor, float *orco, Material *ma, char *col1, char *col2)
 {
 	ShadeResult shr;
-	ShadeTexco *tex= &shi.texture;
-	ShadeGeometry *geom= &shi.geometry;
 	int a;
 	
-	VECCOPY(geom->co, co);
-	geom->vn[0]= -nor[0];
-	geom->vn[1]= -nor[1];
-	geom->vn[2]= -nor[2];
-	VECCOPY(geom->vno, geom->vn);
-	VECCOPY(geom->facenor, geom->vn);
+	VECCOPY(shi.co, co);
+	shi.vn[0]= -nor[0];
+	shi.vn[1]= -nor[1];
+	shi.vn[2]= -nor[2];
+	VECCOPY(shi.vno, shi.vn);
+	VECCOPY(shi.facenor, shi.vn);
 	
 	if(ma->texco) {
-		VECCOPY(tex->lo, orco);
+		VECCOPY(shi.lo, orco);
 		
 		if(ma->texco & TEXCO_GLOB) {
-			VECCOPY(tex->gl, tex->lo);
+			VECCOPY(shi.gl, shi.lo);
 		}
 		if(ma->texco & TEXCO_WINDOW) {
-			VECCOPY(tex->winco, tex->lo);
+			VECCOPY(shi.winco, shi.lo);
 		}
 		if(ma->texco & TEXCO_STICKY) {
-			VECCOPY(tex->sticky, tex->lo);
+			VECCOPY(shi.sticky, shi.lo);
 		}
 		if(ma->texco & TEXCO_OBJECT) {
-			VECCOPY(geom->co, tex->lo);
+			VECCOPY(shi.co, shi.lo);
 		}
 		if(ma->texco & TEXCO_NORM) {
-			VECCOPY(tex->orn, geom->vn);
+			VECCOPY(shi.orn, shi.vn);
 		}
 		if(ma->texco & TEXCO_REFL) {
-			float inp= 2.0*(geom->vn[2]);
-			tex->ref[0]= (inp*geom->vn[0]);
-			tex->ref[1]= (inp*geom->vn[1]);
-			tex->ref[2]= (-1.0+inp*geom->vn[2]);
+			float inp= 2.0*(shi.vn[2]);
+			shi.ref[0]= (inp*shi.vn[0]);
+			shi.ref[1]= (inp*shi.vn[1]);
+			shi.ref[2]= (-1.0+inp*shi.vn[2]);
 		}
 	}
 	
-	shi.material.mat= ma;	/* set each time... node shaders change it */
+	shi.mat= ma;	/* set each time... node shaders change it */
 	// RE_shade_external(NULL, &shi, &shr);
 	memset(&shr, 0, sizeof(shr));
 	
@@ -427,11 +423,11 @@
 	col1[2]= CLAMPIS(a, 0, 255);
 	
 	if(col2) {
-		geom->vn[0]= -geom->vn[0];
-		geom->vn[1]= -geom->vn[1];
-		geom->vn[2]= -geom->vn[2];
+		shi.vn[0]= -shi.vn[0];
+		shi.vn[1]= -shi.vn[1];
+		shi.vn[2]= -shi.vn[2];
 		
-		shi.material.mat= ma;	/* set each time... node shaders change it */
+		shi.mat= ma;	/* set each time... node shaders change it */
 		// XXX RE_shade_external(NULL, &shi, &shr);
 		memset(&shr, 0, sizeof(shr));
 		

Modified: branches/render25/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/render25/source/blender/makesdna/DNA_scene_types.h	2010-07-30 16:15:56 UTC (rev 30908)
+++ branches/render25/source/blender/makesdna/DNA_scene_types.h	2010-07-30 17:18:16 UTC (rev 30909)
@@ -395,7 +395,7 @@
 	/* path tracing */
 	int integrator;
 	int path_samples;
-	int raytrace_all;
+	int path_pad;
 
 	/* subdivision */
 	float subdivision_rate;

Modified: branches/render25/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/render25/source/blender/makesrna/intern/rna_scene.c	2010-07-30 16:15:56 UTC (rev 30908)
+++ branches/render25/source/blender/makesrna/intern/rna_scene.c	2010-07-30 17:18:16 UTC (rev 30909)
@@ -2398,11 +2398,6 @@
 	RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects");
 	RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
 
-	prop= RNA_def_property(srna, "use_raytrace_all", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "raytrace_all", 0);
-	RNA_def_property_ui_text(prop, "Raytrace All", "Raytrace everything ignoring the traceble material option.");
-	RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
-	
 	prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX);
 	RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties");

Modified: branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_camera.c
===================================================================
--- branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_camera.c	2010-07-30 16:15:56 UTC (rev 30908)
+++ branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_camera.c	2010-07-30 17:18:16 UTC (rev 30909)
@@ -43,8 +43,8 @@
 	if(data) {
 		ShadeInput *shi= ((ShaderCallData *)data)->shi;  /* Data we need for shading. */
 		
-		VECCOPY(out[0]->vec, shi->geometry.co);		/* get view vector */
-		out[1]->vec[0]= fabs(shi->geometry.co[2]);		/* get view z-depth */
+		VECCOPY(out[0]->vec, shi->co);		/* get view vector */
+		out[1]->vec[0]= fabs(shi->co[2]);		/* get view z-depth */
 		out[2]->vec[0]= normalize_v3(out[0]->vec);	/* get view distance */
 	}
 }

Modified: branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_geom.c
===================================================================
--- branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_geom.c	2010-07-30 16:15:56 UTC (rev 30908)
+++ branches/render25/source/blender/nodes/intern/SHD_nodes/SHD_geom.c	2010-07-30 17:18:16 UTC (rev 30909)
@@ -52,38 +52,36 @@
 	if(data) {
 		ShadeInput *shi= ((ShaderCallData *)data)->shi;
 		NodeGeometry *ngeo= (NodeGeometry*)node->storage;
-		ShadeGeometry *geom= &shi->geometry;
-		ShadeTexco *tex= &shi->texture;
-		ShadeInputUV *suv= &tex->uv[shi->texture.actuv];
+		ShadeInputUV *suv= &shi->uv[shi->actuv];
 		static float defaultvcol[4] = {1.0f, 1.0f, 1.0f, 1.0f};
 		int i;
 
 		if(ngeo->uvname[0]) {
 			/* find uv layer by name */
-			for(i = 0; i < tex->totuv; i++) {
-				if(strcmp(tex->uv[i].name, ngeo->uvname)==0) {
-					suv= &tex->uv[i];
+			for(i = 0; i < shi->totuv; i++) {
+				if(strcmp(shi->uv[i].name, ngeo->uvname)==0) {
+					suv= &shi->uv[i];
 					break;
 				}
 			}
 		}
 
 		/* out: global, local, view, orco, uv, normal, vertex color */
-		VECCOPY(out[GEOM_OUT_GLOB]->vec, tex->gl);
-		VECCOPY(out[GEOM_OUT_LOCAL]->vec, geom->co);
-		VECCOPY(out[GEOM_OUT_VIEW]->vec, geom->view);
-		VECCOPY(out[GEOM_OUT_ORCO]->vec, tex->lo);
+		VECCOPY(out[GEOM_OUT_GLOB]->vec, shi->gl);
+		VECCOPY(out[GEOM_OUT_LOCAL]->vec, shi->co);
+		VECCOPY(out[GEOM_OUT_VIEW]->vec, shi->view);
+		VECCOPY(out[GEOM_OUT_ORCO]->vec, shi->lo);
 		VECCOPY(out[GEOM_OUT_UV]->vec, suv->uv);
-		VECCOPY(out[GEOM_OUT_NORMAL]->vec, geom->vno);
+		VECCOPY(out[GEOM_OUT_NORMAL]->vec, shi->vno);
 
-		if (tex->totcol) {
+		if (shi->totcol) {
 			/* find vertex color layer by name */
-			ShadeInputCol *scol= &tex->col[0];
+			ShadeInputCol *scol= &shi->col[0];
 
 			if(ngeo->colname[0]) {
-				for(i = 0; i < tex->totcol; i++) {
-					if(strcmp(tex->col[i].name, ngeo->colname)==0) {
-						scol= &tex->col[i];
+				for(i = 0; i < shi->totcol; i++) {
+					if(strcmp(shi->col[i].name, ngeo->colname)==0) {
+						scol= &shi->col[i];
 						break;
 					}
 				}
@@ -95,23 +93,23 @@
 		else
 			memcpy(out[GEOM_OUT_VCOL]->vec, defaultvcol, sizeof(defaultvcol));
 		
-		if(geom->osatex) {
-			out[GEOM_OUT_GLOB]->data= tex->dxgl;
+		if(shi->osatex) {
+			out[GEOM_OUT_GLOB]->data= shi->dxgl;
 			out[GEOM_OUT_GLOB]->datatype= NS_OSA_VECTORS;
-			out[GEOM_OUT_LOCAL]->data= geom->dxco;
+			out[GEOM_OUT_LOCAL]->data= shi->dxco;
 			out[GEOM_OUT_LOCAL]->datatype= NS_OSA_VECTORS;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list