Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_clamp.c
| Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | static int gpu_shader_clamp(GPUMaterial *mat, | ||||
| return (node->custom1 == NODE_CLAMP_MINMAX) ? GPU_stack_link(mat, node, "clamp_value", in, out) : | return (node->custom1 == NODE_CLAMP_MINMAX) ? GPU_stack_link(mat, node, "clamp_value", in, out) : | ||||
| GPU_stack_link(mat, node, "clamp_range", in, out); | GPU_stack_link(mat, node, "clamp_range", in, out); | ||||
| } | } | ||||
| void register_node_type_sh_clamp(void) | void register_node_type_sh_clamp(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_CLAMP, "Clamp", NODE_CLASS_CONVERTOR, 0); | sh_fn_node_type_base(&ntype, SH_NODE_CLAMP, "Clamp", NODE_CLASS_CONVERTOR, 0); | ||||
| node_type_socket_templates(&ntype, sh_node_clamp_in, sh_node_clamp_out); | node_type_socket_templates(&ntype, sh_node_clamp_in, sh_node_clamp_out); | ||||
| node_type_init(&ntype, node_shader_init_clamp); | node_type_init(&ntype, node_shader_init_clamp); | ||||
| node_type_gpu(&ntype, gpu_shader_clamp); | node_type_gpu(&ntype, gpu_shader_clamp); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||