[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29872] branches/render25: Render Branch: world lighting method no shader / shader once / full shading

Brecht Van Lommel brecht at blender.org
Fri Jul 2 15:47:23 CEST 2010


Revision: 29872
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29872
Author:   blendix
Date:     2010-07-02 15:47:23 +0200 (Fri, 02 Jul 2010)

Log Message:
-----------
Render Branch: world lighting method no shader / shader once / full shading
is now just a single "use shader" option. Full shading can't possibly work
well for irradiance caching, and when not doing irradiance caching we might
as well do full shading.

Modified Paths:
--------------
    branches/render25/release/scripts/ui/properties_world.py
    branches/render25/source/blender/makesrna/intern/rna_world.c
    branches/render25/source/blender/render/intern/source/environment.c

Modified: branches/render25/release/scripts/ui/properties_world.py
===================================================================
--- branches/render25/release/scripts/ui/properties_world.py	2010-07-02 12:39:39 UTC (rev 29871)
+++ branches/render25/release/scripts/ui/properties_world.py	2010-07-02 13:47:23 UTC (rev 29872)
@@ -262,7 +262,7 @@
 
         col.prop(light, "use_cache")
         if light.gather_method == 'RAYTRACE':
-            col.prop(light, "use_shader", text="")
+            col.prop(light, "use_shader")
 
         if light.gather_method == 'RAYTRACE':
             col.label(text="Attenuation:")

Modified: branches/render25/source/blender/makesrna/intern/rna_world.c
===================================================================
--- branches/render25/source/blender/makesrna/intern/rna_world.c	2010-07-02 12:39:39 UTC (rev 29871)
+++ branches/render25/source/blender/makesrna/intern/rna_world.c	2010-07-02 13:47:23 UTC (rev 29872)
@@ -207,12 +207,6 @@
 		{WO_LIGHT_GATHER_APPROX, "APPROXIMATE", 0, "Approximate", "Inaccurate, but faster and without noise"},
 		{0, NULL, 0, NULL, NULL}};
 
-	static EnumPropertyItem prop_shading_method_items[] = {
-		{WO_LIGHT_SHADE_NONE, "NONE", 0, "No Shading", "Do not use bump mapping for world lighting"},
-		{WO_LIGHT_SHADE_ONCE, "ONCE", 0, "Shade Once", "Shade once using the averaged incoming light direction, only approximately correct"},
-		{WO_LIGHT_SHADE_FULL, "FULL", 0, "Full Shading", "Use full shade, more accurate but slower and can lead to many more cache samples"},
-		{0, NULL, 0, NULL, NULL}};
-
 	srna= RNA_def_struct(brna, "WorldLighting", NULL);
 	RNA_def_struct_sdna(srna, "World");
 	RNA_def_struct_nested(brna, srna, "World");
@@ -281,10 +275,9 @@
 	RNA_def_property_ui_text(prop, "Gather Method", "");
 	RNA_def_property_update(prop, 0, "rna_World_update");
 
-	prop= RNA_def_property(srna, "shading_method", PROP_ENUM, PROP_NONE);
-	RNA_def_property_enum_sdna(prop, NULL, "ao_shading_method");
-	RNA_def_property_enum_items(prop, prop_shading_method_items);
-	RNA_def_property_ui_text(prop, "Shading Method", "Method to use for shading");
+	prop= RNA_def_property(srna, "use_shader", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "ao_shading_method", 0);
+	RNA_def_property_ui_text(prop, "Use Shader", "Use material diffuse shader for lighting instead of assuming Lambert");
 	RNA_def_property_update(prop, 0, "rna_World_update");
 
 	prop= RNA_def_property(srna, "passes", PROP_INT, PROP_NONE);

Modified: branches/render25/source/blender/render/intern/source/environment.c
===================================================================
--- branches/render25/source/blender/render/intern/source/environment.c	2010-07-02 12:39:39 UTC (rev 29871)
+++ branches/render25/source/blender/render/intern/source/environment.c	2010-07-02 13:47:23 UTC (rev 29872)
@@ -170,6 +170,13 @@
 
 		if(!(re->params.r.mode & R_RAYTRACE) && (re->db.wrld.ao_gather_method == WO_LIGHT_GATHER_RAYTRACE))
 			re->db.wrld.mode &= ~(WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT);
+
+		if(re->db.wrld.ao_shading_method) {
+			if(re->db.wrld.aomode & WO_LIGHT_CACHE)
+				re->db.wrld.ao_shading_method = WO_LIGHT_SHADE_ONCE;
+			else
+				re->db.wrld.ao_shading_method = WO_LIGHT_SHADE_FULL;
+		}
 	}
 	else {
 		memset(&re->db.wrld, 0, sizeof(World));





More information about the Bf-blender-cvs mailing list