Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_volume_scatter.c
- This file was moved from source/blender/nodes/shader/nodes/node_shader_volume_scatter.cc.
| Show All 11 Lines | |||||
| * You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | ||||
| * along with this program; if not, write to the Free Software Foundation, | * along with this program; if not, write to the Free Software Foundation, | ||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| * | * | ||||
| * The Original Code is Copyright (C) 2005 Blender Foundation. | * The Original Code is Copyright (C) 2005 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| #include "node_shader_util.hh" | #include "../node_shader_util.h" | ||||
| /* **************** OUTPUT ******************** */ | /* **************** OUTPUT ******************** */ | ||||
| namespace blender::nodes::node_shader_volume_scatter_cc { | static bNodeSocketTemplate sh_node_volume_scatter_in[] = { | ||||
| {SOCK_RGBA, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, | |||||
| static void node_declare(NodeDeclarationBuilder &b) | {SOCK_FLOAT, N_("Density"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, | ||||
| { | {SOCK_FLOAT, N_("Anisotropy"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, PROP_FACTOR}, | ||||
| b.add_input<decl::Color>(N_("Color")).default_value({0.8f, 0.8f, 0.8f, 1.0f}); | {-1, ""}, | ||||
| b.add_input<decl::Float>(N_("Density")).default_value(1.0f).min(0.0f).max(1000.0f); | }; | ||||
| b.add_input<decl::Float>(N_("Anisotropy")).min(-1.0f).max(1.0f).subtype(PROP_FACTOR); | |||||
| b.add_output<decl::Shader>(N_("Volume")); | static bNodeSocketTemplate sh_node_volume_scatter_out[] = { | ||||
| } | {SOCK_SHADER, N_("Volume")}, | ||||
| {-1, ""}, | |||||
| }; | |||||
| static int node_shader_gpu_volume_scatter(GPUMaterial *mat, | static int node_shader_gpu_volume_scatter(GPUMaterial *mat, | ||||
| bNode *node, | bNode *node, | ||||
| bNodeExecData *UNUSED(execdata), | bNodeExecData *UNUSED(execdata), | ||||
| GPUNodeStack *in, | GPUNodeStack *in, | ||||
| GPUNodeStack *out) | GPUNodeStack *out) | ||||
| { | { | ||||
| return GPU_stack_link(mat, node, "node_volume_scatter", in, out); | return GPU_stack_link(mat, node, "node_volume_scatter", in, out); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_volume_scatter_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_volume_scatter() | void register_node_type_sh_volume_scatter(void) | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_volume_scatter_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_VOLUME_SCATTER, "Volume Scatter", NODE_CLASS_SHADER, 0); | sh_node_type_base(&ntype, SH_NODE_VOLUME_SCATTER, "Volume Scatter", NODE_CLASS_SHADER, 0); | ||||
| ntype.declare = file_ns::node_declare; | node_type_socket_templates(&ntype, sh_node_volume_scatter_in, sh_node_volume_scatter_out); | ||||
| node_type_init(&ntype, nullptr); | node_type_init(&ntype, NULL); | ||||
| node_type_storage(&ntype, "", nullptr, nullptr); | node_type_storage(&ntype, "", NULL, NULL); | ||||
| node_type_gpu(&ntype, file_ns::node_shader_gpu_volume_scatter); | node_type_gpu(&ntype, node_shader_gpu_volume_scatter); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||