Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_tex_coord.c
| Show All 36 Lines | static bNodeSocketTemplate sh_node_tex_coord_out[] = { | ||||
| { SOCK_VECTOR, 0, N_("UV"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | { SOCK_VECTOR, 0, N_("UV"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| { SOCK_VECTOR, 0, N_("Object"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | { SOCK_VECTOR, 0, N_("Object"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| { SOCK_VECTOR, 0, N_("Camera"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | { SOCK_VECTOR, 0, N_("Camera"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| { SOCK_VECTOR, 0, N_("Window"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | { SOCK_VECTOR, 0, N_("Window"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| { SOCK_VECTOR, 0, N_("Reflection"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | { SOCK_VECTOR, 0, N_("Reflection"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static int node_shader_gpu_tex_coord(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int node_shader_gpu_tex_coord(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| GPUNodeLink *orco = GPU_attribute(CD_ORCO, ""); | GPUNodeLink *orco = GPU_attribute(CD_ORCO, ""); | ||||
| GPUNodeLink *mtface = GPU_attribute(CD_MTFACE, ""); | GPUNodeLink *mtface = GPU_attribute(CD_MTFACE, ""); | ||||
| GPUMatType type = GPU_Material_get_type(mat); | GPUMatType type = GPU_Material_get_type(mat); | ||||
| if (type == GPU_MATERIAL_TYPE_WORLD) { | if (type == GPU_MATERIAL_TYPE_WORLD) { | ||||
| return GPU_stack_link(mat, "node_tex_coord_background", in, out, | return GPU_stack_link(mat, node, "node_tex_coord_background", 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), GPU_builtin(GPU_INVERSE_OBJECT_MATRIX), | GPU_builtin(GPU_INVERSE_VIEW_MATRIX), GPU_builtin(GPU_INVERSE_OBJECT_MATRIX), | ||||
| GPU_builtin(GPU_CAMERA_TEXCO_FACTORS), orco, mtface); | GPU_builtin(GPU_CAMERA_TEXCO_FACTORS), orco, mtface); | ||||
| } | } | ||||
| else { | else { | ||||
| return GPU_stack_link(mat, "node_tex_coord", in, out, | return GPU_stack_link(mat, node, "node_tex_coord", 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), GPU_builtin(GPU_INVERSE_OBJECT_MATRIX), | GPU_builtin(GPU_INVERSE_VIEW_MATRIX), GPU_builtin(GPU_INVERSE_OBJECT_MATRIX), | ||||
| GPU_builtin(GPU_CAMERA_TEXCO_FACTORS), orco, mtface); | GPU_builtin(GPU_CAMERA_TEXCO_FACTORS), orco, mtface); | ||||
| } | } | ||||
| } | } | ||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_tex_coord(void) | void register_node_type_sh_tex_coord(void) | ||||
| Show All 12 Lines | |||||