Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c
| Show All 33 Lines | static bNodeSocketTemplate sh_node_ambient_occlusion_in[] = { | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static bNodeSocketTemplate sh_node_ambient_occlusion_out[] = { | static bNodeSocketTemplate sh_node_ambient_occlusion_out[] = { | ||||
| { SOCK_SHADER, 0, N_("AO")}, | { SOCK_SHADER, 0, N_("AO")}, | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static int node_shader_gpu_ambient_occlusion(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int node_shader_gpu_ambient_occlusion(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_VEC4, 0); | |||||
brecht: Can't we handle all sockets automatically in `GPU_stack_link`? That's the purpose of that… | |||||
| return GPU_stack_link(mat, "node_ambient_occlusion", in, out, GPU_builtin(GPU_VIEW_NORMAL)); | return GPU_stack_link(mat, "node_ambient_occlusion", in, out, GPU_builtin(GPU_VIEW_NORMAL)); | ||||
| } | } | ||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_ambient_occlusion(void) | void register_node_type_sh_ambient_occlusion(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| Show All 10 Lines | |||||
Can't we handle all sockets automatically in GPU_stack_link? That's the purpose of that function, to avoid having to link each socket manually.