[Bf-blender-cvs] [ad7458d00c2] blender2.8: Eevee: Transparency: Add Alpha Blend mode.

Clément Foucault noreply at git.blender.org
Tue Jul 11 12:46:10 CEST 2017


Commit: ad7458d00c2833cfcc99dc54280c52b2e5a17cf2
Author: Clément Foucault
Date:   Mon Jul 10 14:42:43 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBad7458d00c2833cfcc99dc54280c52b2e5a17cf2

Eevee: Transparency: Add Alpha Blend mode.

===================================================================

M	source/blender/draw/engines/eevee/eevee_materials.c
M	source/blender/makesdna/DNA_material_types.h
M	source/blender/makesrna/intern/rna_material.c

===================================================================

diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c
index 929e0932144..0681780484d 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -876,6 +876,9 @@ static void material_transparent(
 		case MA_BM_MULTIPLY:
 			cur_state |= DRW_STATE_MULTIPLY;
 			break;
+		case MA_BM_BLEND:
+			cur_state |= DRW_STATE_BLEND;
+			break;
 		default:
 			BLI_assert(0);
 			break;
@@ -940,9 +943,13 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_SceneLayerData *sl
 					break;
 				case MA_BM_ADD:
 				case MA_BM_MULTIPLY:
+				case MA_BM_BLEND:
 					material_transparent(ma, sldata, vedata, do_cull, use_flat_nor,
 					        &gpumat_array[i], &shgrp_array[i]);
 					break;
+				default:
+					BLI_assert(0);
+					break;
 			}
 		}
 
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index fc0f4df4170..c7d7ff1e5db 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -502,6 +502,7 @@ enum {
 	MA_BM_MULTIPLY,
 	MA_BM_CLIP,
 	MA_BM_HASHED,
+	MA_BM_BLEND,
 };
 
 #endif
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 27b9778f280..2625c9cf1f3 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -1811,6 +1811,7 @@ void RNA_def_material(BlenderRNA *brna)
 		{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)"},
+		{MA_BM_BLEND, "BLEND", 0, "Alpha Blend", "Render polygon transparent, depending on alpha channel of the texture"},
 		{0, NULL, 0, NULL, NULL}
 	};




More information about the Bf-blender-cvs mailing list