diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-24 22:19:48 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-29 19:07:08 +0300 |
commit | 1eeb846e781dac3f55d6c108d0fc4c3cfe88f4cc (patch) | |
tree | c80b01eb79df21ad995cb22831ac6012dc0fd1c1 /intern/cycles/render/graph.h | |
parent | fb941679bb6e537a8fb1e1de69b5a446490e761b (diff) |
Fix Cycles viewport render not updating when tweaking displacement shader.
This was disabled to avoid updating the geometry every time when the
material includes displacement, because there was no way to distinguish
between surface shader and displacement updates.
As a solution, we now compute an MD5 hash of the nodes linked to the
displacement socket, and only update the mesh if that changes.
Differential Revision: https://developer.blender.org/D3018
Diffstat (limited to 'intern/cycles/render/graph.h')
-rw-r--r-- | intern/cycles/render/graph.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h index 1d1701b30a2..7ed292b5b96 100644 --- a/intern/cycles/render/graph.h +++ b/intern/cycles/render/graph.h @@ -42,6 +42,7 @@ class SVMCompiler; class OSLCompiler; class OutputNode; class ConstantFolder; +class MD5Hash; /* Bump * @@ -243,6 +244,7 @@ public: size_t num_node_ids; bool finalized; bool simplified; + string displacement_hash; ShaderGraph(); ~ShaderGraph(); @@ -256,6 +258,7 @@ public: void relink(ShaderNode *node, ShaderOutput *from, ShaderOutput *to); void remove_proxy_nodes(); + void compute_displacement_hash(); void simplify(Scene *scene); void finalize(Scene *scene, bool do_bump = false, |