[Bf-blender-cvs] [ad0c2d6] master: Fix T45789: Materials with transparency not properly rendered in viewport in Material Render mode

Sergey Sharybin noreply at git.blender.org
Tue Aug 25 18:15:17 CEST 2015


Commit: ad0c2d6cbb99aa70ae30b072ac6724a151debe85
Author: Sergey Sharybin
Date:   Tue Aug 25 18:10:01 2015 +0200
Branches: master
https://developer.blender.org/rBad0c2d6cbb99aa70ae30b072ac6724a151debe85

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.

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

M	intern/cycles/blender/addon/ui.py

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

diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index c104527..b4a0614 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 = ""




More information about the Bf-blender-cvs mailing list