From ad0c2d6cbb99aa70ae30b072ac6724a151debe85 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 25 Aug 2015 18:10:01 +0200 Subject: [PATCH] Fix T45789: Materials with transparency not properly rendered in viewport in Material Render mode This is a bit tricky one -- ideally viewport should detect whether alpha is used in the shader tree and if so do separate viewport pass for that objects. But in practice it's really tricky to detect whether alpha is affected by shader or not without evaluating the tree for all possible input values. We also can't assume that alpha might always be affected because it'll slow viewport drawing down. For until some smart solution is found simply expose alpha blending mode used by the viewport. It could be found below the Viewport Color settings. --- intern/cycles/blender/addon/ui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index c104527e83a..b4a061424b2 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1164,13 +1164,17 @@ class CyclesMaterial_PT_settings(CyclesButtonsPanel, Panel): col.prop(mat, "alpha") col.separator() - col.prop(mat, "pass_index") + col.label("Viewport Alpha:") + col.prop(mat.game_settings, "alpha_blend", text="") col = split.column(align=True) col.label("Viewport Specular:") col.prop(mat, "specular_color", text="") col.prop(mat, "specular_hardness", text="Hardness") + col.separator() + col.prop(mat, "pass_index") + class CyclesTexture_PT_context(CyclesButtonsPanel, Panel): bl_label = ""