Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_geom.c
| Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | |||||
| static int gpu_shader_geom(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int gpu_shader_geom(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| NodeGeometry *ngeo = (NodeGeometry *)node->storage; | NodeGeometry *ngeo = (NodeGeometry *)node->storage; | ||||
| GPUNodeLink *orco = GPU_attribute(CD_ORCO, ""); | GPUNodeLink *orco = GPU_attribute(CD_ORCO, ""); | ||||
| GPUNodeLink *mtface = GPU_attribute(CD_MTFACE, ngeo->uvname); | GPUNodeLink *mtface = GPU_attribute(CD_MTFACE, ngeo->uvname); | ||||
| GPUNodeLink *mcol = GPU_attribute(CD_MCOL, ngeo->colname); | GPUNodeLink *mcol = GPU_attribute(CD_MCOL, ngeo->colname); | ||||
| bool ret = GPU_stack_link(mat, "geom", in, out, | bool ret = GPU_stack_link(mat, node, "geom", in, out, | ||||
| GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL), | GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL), | ||||
| GPU_builtin(GPU_INVERSE_VIEW_MATRIX), orco, mtface, mcol); | GPU_builtin(GPU_INVERSE_VIEW_MATRIX), orco, mtface, mcol); | ||||
| if (GPU_material_use_world_space_shading(mat)) { | if (GPU_material_use_world_space_shading(mat)) { | ||||
| GPU_link(mat, "vec_math_negate", out[5].link, &out[5].link); | GPU_link(mat, "vec_math_negate", out[5].link, &out[5].link); | ||||
| ret &= GPU_link(mat, "direction_transform_m4v3", out[5].link, GPU_builtin(GPU_INVERSE_VIEW_MATRIX), &out[5].link); | ret &= GPU_link(mat, "direction_transform_m4v3", out[5].link, GPU_builtin(GPU_INVERSE_VIEW_MATRIX), &out[5].link); | ||||
| } | } | ||||
| return ret; | return ret; | ||||
| } | } | ||||
| Show All 16 Lines | |||||