Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2017-05-19 05:59:35 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2017-05-19 05:59:35 +0300
commit4a04d7ae8930502037cd23dc94ed1bc9bc0043ac (patch)
treeb2637d15e995424cf6f5e0413144faee4cfb31de /intern/cycles/render/shader.h
parentcf1127f3801f9809f385ad62f4388220f278a604 (diff)
Fix T51553: Cycles Volume Emission turns black when strength is 0 or color is black
The problem was that Cycles implicitly uses a transparent surface shader when only volume nodes are used, but since the black emission shader gets optimized away, it was no longer detected and therefore no transparent surface was used. Therefore, the shader now stores whether volume nodes were connected before optimizing.
Diffstat (limited to 'intern/cycles/render/shader.h')
-rw-r--r--intern/cycles/render/shader.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h
index a8018231f1a..b6714b13247 100644
--- a/intern/cycles/render/shader.h
+++ b/intern/cycles/render/shader.h
@@ -105,6 +105,15 @@ public:
bool need_update;
bool need_update_attributes;
+ /* If the shader has only volume components, the surface is assumed to
+ * be transparent.
+ * However, graph optimization might remove the volume subgraph, but
+ * since the user connected something to the volume output the surface
+ * should still be transparent.
+ * Therefore, has_volume_connected stores whether some volume subtree
+ * was connected before optimization. */
+ bool has_volume_connected;
+
/* information about shader after compiling */
bool has_surface;
bool has_surface_emission;