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.
This commit is contained in:
Sergey Sharybin 2015-08-25 18:10:01 +02:00
parent 79af9b1260
commit ad0c2d6cbb
Notes: blender-bot 2023-02-14 08:46:18 +01:00
Referenced by issue #45789, Materials with transparency not properly rendered in viewport in Material Render mode (cycles)
1 changed files with 5 additions and 1 deletions

View File

@ -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 = ""