Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_volume_info.c
| Show All 22 Lines | static bNodeSocketTemplate sh_node_volume_info_out[] = { | ||||
| {SOCK_RGBA, 0, N_("Color")}, | {SOCK_RGBA, 0, N_("Color")}, | ||||
| {SOCK_FLOAT, 0, N_("Density")}, | {SOCK_FLOAT, 0, N_("Density")}, | ||||
| {SOCK_FLOAT, 0, N_("Flame")}, | {SOCK_FLOAT, 0, N_("Flame")}, | ||||
| {SOCK_FLOAT, 0, N_("Temperature")}, | {SOCK_FLOAT, 0, N_("Temperature")}, | ||||
| {-1, 0, ""}, | {-1, 0, ""}, | ||||
| }; | }; | ||||
| static int node_shader_gpu_volume_info(GPUMaterial *mat, | static int node_shader_gpu_volume_info(GPUMaterial *mat, | ||||
| bNode *node, | bNode *UNUSED(node), | ||||
| bNodeExecData *UNUSED(execdata), | bNodeExecData *UNUSED(execdata), | ||||
| GPUNodeStack *in, | GPUNodeStack *UNUSED(in), | ||||
| GPUNodeStack *out) | GPUNodeStack *out) | ||||
| { | { | ||||
| if (out[0].hasoutput) { | |||||
| out[0].link = GPU_volume_grid(mat, "color"); | |||||
| } | |||||
| if (out[1].hasoutput) { | |||||
| out[1].link = GPU_volume_grid(mat, "density"); | |||||
| } | |||||
| if (out[2].hasoutput) { | |||||
| out[2].link = GPU_volume_grid(mat, "flame"); | |||||
| } | |||||
| if (out[3].hasoutput) { | |||||
| out[3].link = GPU_volume_grid(mat, "temperature"); | |||||
| } | |||||
| return GPU_stack_link(mat, | return true; | ||||
| node, | |||||
| "node_volume_info", | |||||
| in, | |||||
| out, | |||||
| GPU_builtin(GPU_VOLUME_DENSITY), | |||||
| GPU_builtin(GPU_VOLUME_COLOR), | |||||
| GPU_builtin(GPU_VOLUME_FLAME), | |||||
| GPU_builtin(GPU_VOLUME_TEMPERATURE)); | |||||
| } | } | ||||
| void register_node_type_sh_volume_info(void) | void register_node_type_sh_volume_info(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_VOLUME_INFO, "Volume Info", NODE_CLASS_INPUT, 0); | sh_node_type_base(&ntype, SH_NODE_VOLUME_INFO, "Volume Info", NODE_CLASS_INPUT, 0); | ||||
| node_type_socket_templates(&ntype, NULL, sh_node_volume_info_out); | node_type_socket_templates(&ntype, NULL, sh_node_volume_info_out); | ||||
| node_type_gpu(&ntype, node_shader_gpu_volume_info); | node_type_gpu(&ntype, node_shader_gpu_volume_info); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||