diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-07-09 13:01:29 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-07-11 13:39:35 +0300 |
commit | 05bef13b53e93978716aff8e2efba7ddf72264ed (patch) | |
tree | f1ff4fbf5a7d4c5e1a8f934b17fa47256d40177a /source/blender/makesrna | |
parent | e2c0197a96dbac2aee519fbfb142441c6aed0963 (diff) |
Eevee: Add support for Alpha clip and Hashed Alpha transparency.
Hashed Alpha transparency offers a noisy output but has the benefit of being correctly ordered. Noise can be attenuated with Multisampling / AntiAliasing.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index e60832d86e6..a3c1ae7378e 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -1805,6 +1805,15 @@ void RNA_def_material(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static EnumPropertyItem prop_eevee_blend_items[] = { + {MA_BM_SOLID, "OPAQUE", 0, "Opaque", "Render surface without transparency"}, + // {MA_BM_ADD, "ADD", 0, "Additive", "Render surface and blend the result with additive blending"}, + // {MA_BM_MULTIPLY, "MULTIPLY", 0, "Multiply", "Render surface and blend the result with multiplicative blending"}, + {MA_BM_CLIP, "CLIP", 0, "Alpha Clip", "Use the alpha threshold to clip the visibility (binary visibility)"}, + {MA_BM_HASHED, "HASHED", 0, "Alpha Hashed", "Use noise to dither the binary visibility (works well with multi-samples)"}, + {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"); @@ -1827,7 +1836,18 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_enum_items(prop, transparency_items); RNA_def_property_ui_text(prop, "Transparency Method", "Method to use for rendering transparency"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + + /* Blending (only Eevee for now) */ + prop = RNA_def_property(srna, "blend_method", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_eevee_blend_items); + 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, "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"); + /* For Preview Render */ prop = RNA_def_property(srna, "preview_render_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "pr_type"); |