Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_tex_white_noise.c
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | static int gpu_shader_tex_white_noise(GPUMaterial *mat, | ||||
| static const char *names[] = { | static const char *names[] = { | ||||
| "", | "", | ||||
| "node_white_noise_1d", | "node_white_noise_1d", | ||||
| "node_white_noise_2d", | "node_white_noise_2d", | ||||
| "node_white_noise_3d", | "node_white_noise_3d", | ||||
| "node_white_noise_4d", | "node_white_noise_4d", | ||||
| }; | }; | ||||
| if (node->custom1 < ARRAY_SIZE(names) && names[node->custom1]) { | |||||
| return GPU_stack_link(mat, node, names[node->custom1], in, out); | return GPU_stack_link(mat, node, names[node->custom1], in, out); | ||||
| } | } | ||||
| else { | |||||
| return 0; | |||||
| } | |||||
| } | |||||
| static void node_shader_update_tex_white_noise(bNodeTree *UNUSED(ntree), bNode *node) | static void node_shader_update_tex_white_noise(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| bNodeSocket *sockVector = nodeFindSocket(node, SOCK_IN, "Vector"); | bNodeSocket *sockVector = nodeFindSocket(node, SOCK_IN, "Vector"); | ||||
| bNodeSocket *sockW = nodeFindSocket(node, SOCK_IN, "W"); | bNodeSocket *sockW = nodeFindSocket(node, SOCK_IN, "W"); | ||||
| nodeSetSocketAvailability(sockVector, node->custom1 != 1); | nodeSetSocketAvailability(sockVector, node->custom1 != 1); | ||||
| nodeSetSocketAvailability(sockW, node->custom1 == 1 || node->custom1 == 4); | nodeSetSocketAvailability(sockW, node->custom1 == 1 || node->custom1 == 4); | ||||
| Show All 14 Lines | |||||