diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-09-19 13:21:32 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-09-25 15:08:32 +0400 |
commit | d165b1b266b9d19775ee73733b63824b8551aea6 (patch) | |
tree | 09ff334c725e519c8c3cd946b876b28e5675263c /intern/cycles/render/graph.h | |
parent | b3d414cc216222e115924aa4d6b4ecf43f459d78 (diff) |
Cycles: Add method to dump current shader graph to the graphiz file
This is rather useful to see how good optimization went and so.
Currently uses quite simple notation: shader nodes are nodes on the
graph, connects between graph nodes are named by the sockets names,
so i.e. connection between BSDF and Mix would be named bsdf:closure1.
Could be improved in the feature to draw fancier graph, but it's good
enough already.
Use in the following way:
- To create graphix file call graph->dump_graph("graph.dot")
- To visualize the grapf call: dot -Tpng graph.dot -o graph.png
Diffstat (limited to 'intern/cycles/render/graph.h')
-rw-r--r-- | intern/cycles/render/graph.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h index 7bfd51cdee3..7b95703d3aa 100644 --- a/intern/cycles/render/graph.h +++ b/intern/cycles/render/graph.h @@ -250,6 +250,8 @@ public: void remove_unneeded_nodes(); void finalize(bool do_bump = false, bool do_osl = false); + void dump_graph(const char *filename); + protected: typedef pair<ShaderNode* const, ShaderNode*> NodePair; |