Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_mixRgb.c
| Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static int gpu_shader_mix_rgb(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int gpu_shader_mix_rgb(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| static const char *names[] = {"mix_blend", "mix_add", "mix_mult", "mix_sub", | static const char *names[] = {"mix_blend", "mix_add", "mix_mult", "mix_sub", | ||||
| "mix_screen", "mix_div", "mix_diff", "mix_dark", "mix_light", | "mix_screen", "mix_div", "mix_diff", "mix_dark", "mix_light", | ||||
| "mix_overlay", "mix_dodge", "mix_burn", "mix_hue", "mix_sat", | "mix_overlay", "mix_dodge", "mix_burn", "mix_hue", "mix_sat", | ||||
| "mix_val", "mix_color", "mix_soft", "mix_linear"}; | "mix_val", "mix_color", "mix_soft", "mix_linear"}; | ||||
| int ret = GPU_stack_link(mat, names[node->custom1], in, out); | |||||
| int ret = GPU_stack_link(mat, node, names[node->custom1], in, out); | |||||
| if (ret && node->custom2 & SHD_MIXRGB_CLAMP) { | if (ret && node->custom2 & SHD_MIXRGB_CLAMP) { | ||||
| float min[3] = {0.0f, 0.0f, 0.0f}; | float min[3] = {0.0f, 0.0f, 0.0f}; | ||||
| float max[3] = {1.0f, 1.0f, 1.0f}; | float max[3] = {1.0f, 1.0f, 1.0f}; | ||||
| GPU_link(mat, "clamp_vec3", out[0].link, GPU_uniform(min), GPU_uniform(max), &out[0].link); | GPU_link(mat, "clamp_vec3", out[0].link, GPU_uniform(min), GPU_uniform(max), &out[0].link); | ||||
| } | } | ||||
| return ret; | return ret; | ||||
| } | } | ||||
| Show All 14 Lines | |||||