Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_vector_displacement.c
- This file was moved from source/blender/nodes/shader/nodes/node_shader_vector_displacement.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_vector_displacement_cc { | |||||
| static bNodeSocketTemplate sh_node_vector_displacement_in[] = { | static bNodeSocketTemplate sh_node_vector_displacement_in[] = { | ||||
| {SOCK_RGBA, N_("Vector"), 0.00f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f, PROP_NONE, SOCK_HIDE_VALUE}, | {SOCK_RGBA, N_("Vector"), 0.00f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f, PROP_NONE, SOCK_HIDE_VALUE}, | ||||
| {SOCK_FLOAT, N_("Midlevel"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, | {SOCK_FLOAT, N_("Midlevel"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, | ||||
| {SOCK_FLOAT, N_("Scale"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, | {SOCK_FLOAT, N_("Scale"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| static bNodeSocketTemplate sh_node_vector_displacement_out[] = { | static bNodeSocketTemplate sh_node_vector_displacement_out[] = { | ||||
| Show All 26 Lines | static int gpu_shader_vector_displacement(GPUMaterial *mat, | ||||
| if (node->custom1 == SHD_SPACE_OBJECT) { | if (node->custom1 == SHD_SPACE_OBJECT) { | ||||
| return GPU_stack_link( | return GPU_stack_link( | ||||
| mat, node, "node_vector_displacement_object", in, out, GPU_builtin(GPU_OBJECT_MATRIX)); | mat, node, "node_vector_displacement_object", in, out, GPU_builtin(GPU_OBJECT_MATRIX)); | ||||
| } | } | ||||
| return GPU_stack_link(mat, node, "node_vector_displacement_world", in, out); | return GPU_stack_link(mat, node, "node_vector_displacement_world", in, out); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_vector_displacement_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_vector_displacement() | void register_node_type_sh_vector_displacement(void) | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_vector_displacement_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base( | sh_node_type_base( | ||||
| &ntype, SH_NODE_VECTOR_DISPLACEMENT, "Vector Displacement", NODE_CLASS_OP_VECTOR, 0); | &ntype, SH_NODE_VECTOR_DISPLACEMENT, "Vector Displacement", NODE_CLASS_OP_VECTOR, 0); | ||||
| node_type_socket_templates( | node_type_socket_templates( | ||||
| &ntype, file_ns::sh_node_vector_displacement_in, file_ns::sh_node_vector_displacement_out); | &ntype, sh_node_vector_displacement_in, sh_node_vector_displacement_out); | ||||
| node_type_storage(&ntype, "", nullptr, nullptr); | node_type_storage(&ntype, "", NULL, NULL); | ||||
| node_type_init(&ntype, file_ns::node_shader_init_vector_displacement); | node_type_init(&ntype, node_shader_init_vector_displacement); | ||||
| node_type_gpu(&ntype, file_ns::gpu_shader_vector_displacement); | node_type_gpu(&ntype, gpu_shader_vector_displacement); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||