[Bf-blender-cvs] [17a16b5] master: Fix T46936: cycles GLSL should not draw outlines for transparent materials.

Brecht Van Lommel noreply at git.blender.org
Tue Dec 15 02:09:26 CET 2015


Commit: 17a16b57df2d6e45c2f9e0d937c7baf8a386764b
Author: Brecht Van Lommel
Date:   Tue Dec 15 02:07:26 2015 +0100
Branches: master
https://developer.blender.org/rB17a16b57df2d6e45c2f9e0d937c7baf8a386764b

Fix T46936: cycles GLSL should not draw outlines for transparent materials.

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

M	source/blender/gpu/intern/gpu_material.c

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

diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index a176297..464bec1 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1787,18 +1787,21 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma, bool use_open
 	mat->is_opensubdiv = use_opensubdiv;
 
 	/* render pipeline option */
-	if (ma->mode & MA_TRANSP)
+	bool new_shading_nodes = BKE_scene_use_new_shading_nodes(scene);
+	if (!new_shading_nodes && (ma->mode & MA_TRANSP))
+		GPU_material_enable_alpha(mat);
+	else if (new_shading_nodes && ma->alpha < 1.0f)
 		GPU_material_enable_alpha(mat);
 
 	if (!(scene->gm.flag & GAME_GLSL_NO_NODES) && ma->nodetree && ma->use_nodes) {
 		/* create nodes */
-		if (BKE_scene_use_new_shading_nodes(scene))
+		if (new_shading_nodes)
 			ntreeGPUMaterialNodes(ma->nodetree, mat, NODE_NEW_SHADING);
 		else
 			ntreeGPUMaterialNodes(ma->nodetree, mat, NODE_OLD_SHADING);
 	}
 	else {
-		if (BKE_scene_use_new_shading_nodes(scene)) {
+		if (new_shading_nodes) {
 			/* create simple diffuse material instead of nodes */
 			outlink = gpu_material_diffuse_bsdf(mat, ma);
 		}




More information about the Bf-blender-cvs mailing list