Fix T46936: cycles GLSL should not draw outlines for transparent materials.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user