Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_valToRgb.c
| Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | static int gpu_shader_valtorgb(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| return GPU_stack_link(mat, "valtorgb", in, out, GPU_texture(size, array)); | return GPU_stack_link(mat, "valtorgb", in, out, GPU_texture(size, array)); | ||||
| } | } | ||||
| void register_node_type_sh_valtorgb(void) | void register_node_type_sh_valtorgb(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, 0); | sh_node_type_base(&ntype, SH_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, 0); | ||||
| node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); | node_type_add_compatibility(&ntype, "CYCLES"); | ||||
| node_type_add_compatibility(&ntype, "BLENDER_RENDER"); | |||||
| node_type_set_category(&ntype, "Converter"); | |||||
| node_type_socket_templates(&ntype, sh_node_valtorgb_in, sh_node_valtorgb_out); | node_type_socket_templates(&ntype, sh_node_valtorgb_in, sh_node_valtorgb_out); | ||||
| node_type_init(&ntype, node_shader_init_valtorgb); | node_type_init(&ntype, node_shader_init_valtorgb); | ||||
| node_type_size_preset(&ntype, NODE_SIZE_LARGE); | node_type_size_preset(&ntype, NODE_SIZE_LARGE); | ||||
| node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage); | node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage); | ||||
| node_type_exec(&ntype, NULL, NULL, node_shader_exec_valtorgb); | node_type_exec(&ntype, NULL, NULL, node_shader_exec_valtorgb); | ||||
| node_type_gpu(&ntype, gpu_shader_valtorgb); | node_type_gpu(&ntype, gpu_shader_valtorgb); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| Show All 26 Lines | static int gpu_shader_rgbtobw(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| return GPU_stack_link(mat, "rgbtobw", in, out); | return GPU_stack_link(mat, "rgbtobw", in, out); | ||||
| } | } | ||||
| void register_node_type_sh_rgbtobw(void) | void register_node_type_sh_rgbtobw(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0); | sh_node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0); | ||||
| node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); | node_type_add_compatibility(&ntype, "CYCLES"); | ||||
| node_type_add_compatibility(&ntype, "BLENDER_RENDER"); | |||||
| node_type_set_category(&ntype, "Converter"); | |||||
| node_type_socket_templates(&ntype, sh_node_rgbtobw_in, sh_node_rgbtobw_out); | node_type_socket_templates(&ntype, sh_node_rgbtobw_in, sh_node_rgbtobw_out); | ||||
| node_type_exec(&ntype, NULL, NULL, node_shader_exec_rgbtobw); | node_type_exec(&ntype, NULL, NULL, node_shader_exec_rgbtobw); | ||||
| node_type_gpu(&ntype, gpu_shader_rgbtobw); | node_type_gpu(&ntype, gpu_shader_rgbtobw); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||