diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-07-11 13:39:20 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-07-11 13:39:35 +0300 |
commit | c0f2cbab4eef7047adc290f9abd8b4ffae6450eb (patch) | |
tree | 1d62033031b8f741841c4637304742d65d667aad /source/blender/makesrna/intern/rna_material.c | |
parent | ec9330d206494a934df64d52f133c920d2ea41d3 (diff) |
Eevee: Transparency: Add transparent Shadow method UI.
Diffstat (limited to 'source/blender/makesrna/intern/rna_material.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 1d9302f5d37..d01ce407815 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -1815,6 +1815,14 @@ void RNA_def_material(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static EnumPropertyItem prop_eevee_blend_shadow_items[] = { + {MA_BS_NONE, "NONE", 0, "None", "Material will cast no shadow"}, + {MA_BS_SOLID, "OPAQUE", 0, "Opaque", "Material will cast shadows without transparency"}, + {MA_BS_CLIP, "CLIP", 0, "Clip", "Use the alpha threshold to clip the visibility (binary visibility)"}, + {MA_BS_HASHED, "HASHED", 0, "Hashed", "Use noise to dither the binary visibility and use filtering to reduce the noise"}, + {0, NULL, 0, NULL, NULL} + }; + srna = RNA_def_struct(brna, "Material", "ID"); RNA_def_struct_ui_text(srna, "Material", "Material data-block to define the appearance of geometric objects for rendering"); @@ -1844,16 +1852,22 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Blend Mode", "Blend Mode for Transparent Faces"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); + prop = RNA_def_property(srna, "transparent_shadow_method", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "blend_shadow"); + RNA_def_property_enum_items(prop, prop_eevee_blend_shadow_items); + RNA_def_property_ui_text(prop, "Transparent Shadow", "Shadow method for transparent material"); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); + prop = RNA_def_property(srna, "alpha_threshold", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Clip Threshold", "A pixel is rendered only if its alpha value is above this threshold"); - RNA_def_property_update(prop, 0, "rna_Material_update"); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - prop = RNA_def_property(srna, "blend_hide_backside", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "transparent_hide_backside", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "blend_flag", MA_BL_HIDE_BACKSIDE); RNA_def_property_ui_text(prop, "Hide Backside" , "Limit transparency to a single layer " "(avoids transparency sorting problems)"); - RNA_def_property_update(prop, 0, "rna_Material_update"); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); /* For Preview Render */ prop = RNA_def_property(srna, "preview_render_type", PROP_ENUM, PROP_NONE); |