diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-05-08 01:18:32 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-05-22 18:29:25 +0300 |
commit | 9b9921b765bca2dacc7ec0633dcf0ab1ab68be68 (patch) | |
tree | 0eb5a3745a9eeb6596ba230a2de941fc5b0baa31 /intern/cycles/render/shader.cpp | |
parent | e7d13b8a1da046d7bb78a3c0e21bbb575ed6074e (diff) |
Code refactor: nodify Cycles shader and lights.
Differential Revision: https://developer.blender.org/D2016
Diffstat (limited to 'intern/cycles/render/shader.cpp')
-rw-r--r-- | intern/cycles/render/shader.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index 1453958a0aa..b140af66b5b 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -131,20 +131,36 @@ static void beckmann_table_build(vector<float>& table) /* Shader */ +NODE_DEFINE(Shader) +{ + NodeType* type = NodeType::add("shader", create); + + SOCKET_BOOLEAN(use_mis, "Use MIS", true); + SOCKET_BOOLEAN(use_transparent_shadow, "Use Transparent Shadow", true); + SOCKET_BOOLEAN(heterogeneous_volume, "Heterogeneous Volume", true); + + static NodeEnum volume_sampling_method_enum; + volume_sampling_method_enum.insert("distance", VOLUME_SAMPLING_DISTANCE); + volume_sampling_method_enum.insert("equiangular", VOLUME_SAMPLING_EQUIANGULAR); + volume_sampling_method_enum.insert("multiple_importance", VOLUME_SAMPLING_MULTIPLE_IMPORTANCE); + SOCKET_ENUM(volume_sampling_method, "Volume Sampling Method", volume_sampling_method_enum, VOLUME_SAMPLING_DISTANCE); + + static NodeEnum volume_interpolation_method_enum; + volume_interpolation_method_enum.insert("linear", VOLUME_INTERPOLATION_LINEAR); + volume_interpolation_method_enum.insert("cubic", VOLUME_INTERPOLATION_CUBIC); + SOCKET_ENUM(volume_interpolation_method, "Volume Interpolation Method", volume_interpolation_method_enum, VOLUME_INTERPOLATION_LINEAR); + + return type; +} + Shader::Shader() +: Node(node_type) { - name = ""; pass_id = 0; graph = NULL; graph_bump = NULL; - use_mis = true; - use_transparent_shadow = true; - heterogeneous_volume = true; - volume_sampling_method = VOLUME_SAMPLING_DISTANCE; - volume_interpolation_method = VOLUME_INTERPOLATION_LINEAR; - has_surface = false; has_surface_transparent = false; has_surface_emission = false; |