[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26814] branches/render25: Render Branch: WIP commit

Brecht Van Lommel brecht at blender.org
Thu Feb 11 20:29:43 CET 2010


Revision: 26814
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26814
Author:   blendix
Date:     2010-02-11 20:29:43 +0100 (Thu, 11 Feb 2010)

Log Message:
-----------
Render Branch: WIP commit

* Pixel cache now works for raytraced AO/env/indirect.
* Falloff distance value is now only used for custom curve, linear and
  quadratic now have a smooth factor (range 0-1).
* Lamp multisampling code moved from shadow to shading, so that both
  shading and shadow can be multisampled. This should give correct area
  lights at the cost of noise.
* Halo now uses same lamp code as surface instead of duplicating it.
* Fix in volume code, was too bright now with lamp changes.
* Only shadow materials are now computed different, sharing more code
  but not matching old behavior yet.

Modified Paths:
--------------
    branches/render25/release/scripts/ui/properties_data_lamp.py
    branches/render25/release/scripts/ui/properties_render.py
    branches/render25/release/scripts/ui/properties_world.py
    branches/render25/source/blender/blenkernel/intern/object.c
    branches/render25/source/blender/blenloader/intern/readfile.c
    branches/render25/source/blender/gpu/intern/gpu_draw.c
    branches/render25/source/blender/gpu/intern/gpu_material.c
    branches/render25/source/blender/makesdna/DNA_lamp_types.h
    branches/render25/source/blender/makesrna/RNA_types.h
    branches/render25/source/blender/makesrna/intern/makesrna.c
    branches/render25/source/blender/makesrna/intern/rna_lamp.c
    branches/render25/source/blender/render/extern/include/RE_shader_ext.h
    branches/render25/source/blender/render/intern/include/lamp.h
    branches/render25/source/blender/render/intern/include/material.h
    branches/render25/source/blender/render/intern/include/raytrace.h
    branches/render25/source/blender/render/intern/include/render_types.h
    branches/render25/source/blender/render/intern/source/cache.c
    branches/render25/source/blender/render/intern/source/convertblender.c
    branches/render25/source/blender/render/intern/source/database.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/path.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/shadeoutput.c
    branches/render25/source/blender/render/intern/source/volumetric.c

Modified: branches/render25/release/scripts/ui/properties_data_lamp.py
===================================================================
--- branches/render25/release/scripts/ui/properties_data_lamp.py	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/release/scripts/ui/properties_data_lamp.py	2010-02-11 19:29:43 UTC (rev 26814)
@@ -101,18 +101,15 @@
         if lamp.type in ('POINT', 'SPOT'):
             sub.label(text="Falloff:")
             sub.prop(lamp, "falloff_type", text="")
-            sub.prop(lamp, "falloff_distance", text="Distance")
+            if lamp.falloff_type == 'CUSTOM_CURVE':
+                sub.prop(lamp, "falloff_distance", text="Distance")
+            else:
+                sub.prop(lamp, "falloff_smooth", text="Smooth")
 
-            if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
-                col.label(text="Attenuation Factors:")
-                sub = col.column(align=True)
-                sub.prop(lamp, "linear_attenuation", slider=True, text="Linear")
-                sub.prop(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
-
             col.prop(lamp, "sphere")
 
         if lamp.type == 'AREA':
-            col.prop(lamp, "fallof_distance", text="Distance")
+            col.prop(lamp, "falloff_distance", text="Distance")
             col.prop(lamp, "gamma")
 
         if wide_ui:

Modified: branches/render25/release/scripts/ui/properties_render.py
===================================================================
--- branches/render25/release/scripts/ui/properties_render.py	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/release/scripts/ui/properties_render.py	2010-02-11 19:29:43 UTC (rev 26814)
@@ -61,10 +61,8 @@
 
         layout.prop(rd, "display_mode", text="Display")
         layout.prop(rd, "integrator")
+        layout.prop(rd, "path_samples")
 
-        if rd.integrator == 'PATH_TRACER':
-            layout.prop(rd, "path_samples")
-
 class RENDER_PT_layers(RenderButtonsPanel):
     bl_label = "Layers"
     bl_default_closed = True

Modified: branches/render25/release/scripts/ui/properties_world.py
===================================================================
--- branches/render25/release/scripts/ui/properties_world.py	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/release/scripts/ui/properties_world.py	2010-02-11 19:29:43 UTC (rev 26814)
@@ -256,6 +256,8 @@
                 sub.prop(light, "threshold")
                 sub.prop(light, "adapt_to_speed", slider=True)
 
+            sub.prop(light, "pixel_cache")
+
         if light.gather_method == 'APPROXIMATE':
             col = split.column()
 

Modified: branches/render25/source/blender/blenkernel/intern/object.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/object.c	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/source/blender/blenkernel/intern/object.c	2010-02-11 19:29:43 UTC (rev 26814)
@@ -793,7 +793,6 @@
 	la->dist= 0.0f;
 	la->spotsize= 45.0f;
 	la->spotblend= 0.15f;
-	la->att2= 1.0f;
 	la->mode= LA_SHAD_BUF;
 	la->bufsize= 512;
 	la->clipsta= 0.5f;

Modified: branches/render25/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/render25/source/blender/blenloader/intern/readfile.c	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/source/blender/blenloader/intern/readfile.c	2010-02-11 19:29:43 UTC (rev 26814)
@@ -6406,9 +6406,10 @@
 		if(la->ray_samp_method == LA_SAMP_CONSTANT)
 			la->ray_samp_method= LA_SAMP_HAMMERSLEY;
 		if(la->falloff_type == LA_FALLOFF_SLIDERS)
-			la->falloff_type= LA_FALLOFF_INVSQUARE;
+			la->falloff_type= LA_FALLOFF_INVLINEAR;
 
 		la->energy *= M_PI*la->dist;
+		la->falloff_smooth = 1.0f;
 	}
 }
 

Modified: branches/render25/source/blender/gpu/intern/gpu_draw.c
===================================================================
--- branches/render25/source/blender/gpu/intern/gpu_draw.c	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/source/blender/gpu/intern/gpu_draw.c	2010-02-11 19:29:43 UTC (rev 26814)
@@ -1205,8 +1205,8 @@
 
 			glLightfv(GL_LIGHT0+count, GL_POSITION, position); 
 			glLightf(GL_LIGHT0+count, GL_CONSTANT_ATTENUATION, 1.0);
-			glLightf(GL_LIGHT0+count, GL_LINEAR_ATTENUATION, la->att1/la->dist);
-			glLightf(GL_LIGHT0+count, GL_QUADRATIC_ATTENUATION, la->att2/(la->dist*la->dist));
+			glLightf(GL_LIGHT0+count, GL_LINEAR_ATTENUATION, 0.0f/la->dist);
+			glLightf(GL_LIGHT0+count, GL_QUADRATIC_ATTENUATION, 1.0f/(la->dist*la->dist));
 			
 			if(la->type==LA_SPOT) {
 				/* spot lamp */

Modified: branches/render25/source/blender/gpu/intern/gpu_material.c
===================================================================
--- branches/render25/source/blender/gpu/intern/gpu_material.c	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/source/blender/gpu/intern/gpu_material.c	2010-02-11 19:29:43 UTC (rev 26814)
@@ -115,7 +115,7 @@
 	float dynimat[4][4];
 
 	float spotsi, spotbl, k;
-	float dist, att1, att2;
+	float dist;
 
 	float bias, d, clipend;
 	int size;
@@ -396,9 +396,6 @@
 			case LA_FALLOFF_INVSQUARE:
 				GPU_link(mat, "lamp_falloff_invsquare", GPU_uniform(&lamp->dist), *dist, &visifac);
 				break;
-			case LA_FALLOFF_SLIDERS:
-				GPU_link(mat, "lamp_falloff_sliders", GPU_uniform(&lamp->dist), GPU_uniform(&lamp->att1), GPU_uniform(&lamp->att2), *dist, &visifac);
-				break;
 			case LA_FALLOFF_CURVE:
 				{
 					float *array;
@@ -1349,8 +1346,6 @@
 
 	lamp->dist= la->dist;
 	lamp->falloff_type= la->falloff_type;
-	lamp->att1= la->att1;
-	lamp->att2= la->att2;
 	lamp->curfalloff= la->curfalloff;
 
 	/* initshadowbuf */

Modified: branches/render25/source/blender/makesdna/DNA_lamp_types.h
===================================================================
--- branches/render25/source/blender/makesdna/DNA_lamp_types.h	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/source/blender/makesdna/DNA_lamp_types.h	2010-02-11 19:29:43 UTC (rev 26814)
@@ -51,19 +51,17 @@
 	
 	short colormodel, totex;
 	float r, g, b, k;
-	float shdwr, shdwg, shdwb, shdwpad;
+	float shdwr, shdwg, shdwb;
 	
-	float energy, dist, spotsize, spotblend;
+	float energy, spotsize, spotblend;
 	float haint;
 	
-	
-	float att1, att2;	/* Quad1 and Quad2 attenuation */
 	struct CurveMapping *curfalloff;
-	short falloff_type;
-	short pad2;
+	short falloff_type, pad2;
+	float falloff_smooth, dist;
 	
 	float clipsta, clipend, shadspotsize;
-	float bias, soft, compressthresh, pad5[3];
+	float bias, soft, compressthresh, pad5;
 	short bufsize, samp, buffers, filtertype;
 	char bufflag, buftype;
 	

Modified: branches/render25/source/blender/makesrna/RNA_types.h
===================================================================
--- branches/render25/source/blender/makesrna/RNA_types.h	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/source/blender/makesrna/RNA_types.h	2010-02-11 19:29:43 UTC (rev 26814)
@@ -81,8 +81,7 @@
 	PROP_UNIT_ROTATION = (5<<16),		/* radians */
 	PROP_UNIT_TIME = (6<<16),			/* frame */
 	PROP_UNIT_VELOCITY = (7<<16),		/* m/s */
-	PROP_UNIT_ACCELERATION = (8<<16),	/* m/(s^2) */
-	PROP_UNIT_POWER = (9<<16)			/* Watt */
+	PROP_UNIT_ACCELERATION = (8<<16)	/* m/(s^2) */
 } PropertyUnit;
 
 #define RNA_SUBTYPE_UNIT(subtype) ((subtype) & 0x00FF0000)
@@ -120,7 +119,6 @@
 	PROP_AXISANGLE = 28,
 	PROP_XYZ = 29,
 	PROP_COLOR_GAMMA = 30,
-	PROP_POWER = 31|PROP_UNIT_POWER,
 
 	/* booleans */
 	PROP_LAYER = 40,

Modified: branches/render25/source/blender/makesrna/intern/makesrna.c
===================================================================
--- branches/render25/source/blender/makesrna/intern/makesrna.c	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/source/blender/makesrna/intern/makesrna.c	2010-02-11 19:29:43 UTC (rev 26814)
@@ -1567,7 +1567,6 @@
 		case PROP_COLOR_GAMMA: return "PROP_COLOR_GAMMA";
 		case PROP_LAYER: return "PROP_LAYER";
 		case PROP_LAYER_MEMBER: return "PROP_LAYER_MEMBER";
-		case PROP_POWER: return "PROP_POWER";
 		default: {
 			/* incase we dont have a type preset that includes the subtype */
 			if(RNA_SUBTYPE_UNIT(type)) {
@@ -1592,7 +1591,6 @@
 		case PROP_UNIT_TIME:		return "PROP_UNIT_TIME";
 		case PROP_UNIT_VELOCITY:	return "PROP_UNIT_VELOCITY";
 		case PROP_UNIT_ACCELERATION:return "PROP_UNIT_ACCELERATION";
-		case PROP_UNIT_POWER:		return "PROP_UNIT_POWER";
 		default:					return "PROP_UNIT_UNKNOWN";
 	}
 }

Modified: branches/render25/source/blender/makesrna/intern/rna_lamp.c
===================================================================
--- branches/render25/source/blender/makesrna/intern/rna_lamp.c	2010-02-11 19:20:49 UTC (rev 26813)
+++ branches/render25/source/blender/makesrna/intern/rna_lamp.c	2010-02-11 19:29:43 UTC (rev 26814)
@@ -344,10 +344,15 @@
 	prop= RNA_def_property(srna, "falloff_distance", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "dist");
 	RNA_def_property_ui_range(prop, 0, 1000, 1.0, 2);
-	RNA_def_property_ui_text(prop, "Falloff distance", "Extra distance added to falloff to smooth harsh light when the lamp is nearby.");
+	RNA_def_property_ui_text(prop, "Falloff distance", "For custom falloff curve, the distance over which the curve is applied.");
 	RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
 
-	prop= RNA_def_property(srna, "power", PROP_FLOAT, PROP_POWER);
+	prop= RNA_def_property(srna, "falloff_smooth", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "falloff_smooth");
+	RNA_def_property_ui_text(prop, "Falloff Smooth", "Artificially smooth lamp falloff to avoid harsh light when the lamp is nearby.");
+	RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
+
+	prop= RNA_def_property(srna, "power", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "energy");
 	RNA_def_property_ui_range(prop, 0, 1000.0, 1.0, 2);
 	RNA_def_property_ui_text(prop, "Power", "Amount of light that the lamp emits.");
@@ -412,18 +417,6 @@
 	RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE);
 	RNA_def_property_ui_text(prop, "Sphere", "Sets light intensity to zero beyond lamp distance.");
 	RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
-
-	prop= RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_float_sdna(prop, NULL, "att1");
-	RNA_def_property_range(prop, 0.0f, 1.0f);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list