Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2011-03-08 19:08:43 +0300
committerTon Roosendaal <ton@blender.org>2011-03-08 19:08:43 +0300
commit3a43e08deb4354175e5d40a37dc4dafea476176b (patch)
tree5a99ad3e6aa7dac70f344ccbf97dfc1fd0adb64a /source/blender/makesrna/intern/rna_material.c
parent3d05311d3cfa0b0fd0cde284ec59880179e292a1 (diff)
Bugfix & Feature fix: Only Shadow Material options
Patch from Miika Hämäläinen. The old Material "Only Shadow" used an ancient 'best guess' formula using Lamp Distance and some averaging for converting shadow values to alpha. A couple of bug reporters already complained about the not very predictable renders. Miika fixed this by adding two new options, to only give the true shadow factor exclusively, or to give a result including light intensity values. More info: http://projects.blender.org/tracker/index.php?func=detail&aid=26413&group_id=9&atid=127
Diffstat (limited to 'source/blender/makesrna/intern/rna_material.c')
-rw-r--r--source/blender/makesrna/intern/rna_material.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index ce568c2af63..179b0770322 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -1583,6 +1583,12 @@ void RNA_def_material(BlenderRNA *brna)
{MA_SPHERE_A, "SPHERE_A", ICON_MAT_SPHERE_SKY, "Flat", "Preview type: Large sphere with sky"},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem prop_shadows_only_items[] = {
+ {MA_SO_OLD, "SO_OLD", 0, "Shadow and Distance", ""},
+ {MA_SO_SHADOW, "SO_SHADOW", 0, "Shadow Only", ""},
+ {MA_SO_SHADED, "SO_SHADED", 0, "Shadow and Shading", ""},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "Material", "ID");
RNA_def_struct_ui_text(srna, "Material", "Material datablock to defined the appearance of geometric objects for rendering");
RNA_def_struct_ui_icon(srna, ICON_MATERIAL_DATA);
@@ -1713,6 +1719,12 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow", "Renders shadows as the material's alpha value, making materials transparent except for shadowed areas");
RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "shadow_only_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "shadowonly_flag");
+ RNA_def_property_enum_items(prop, prop_shadows_only_items);
+ RNA_def_property_ui_text(prop, "Shadow Type", "How to draw shadows");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_face_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE);