Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_tex_image.c
| Context not available. | |||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License | * modify it under the terms of the GNU General Public License | ||||
| * as published by the Free Software Foundation; either version 2 | * as published by the Free Software Foundation; either version 2 | ||||
| * of the License, or (at your option) any later version. | * of the License, or (at your option) any later version. | ||||
| * | * | ||||
| * This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | ||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| Context not available. | |||||
| GPUNodeLink *norm; | GPUNodeLink *norm; | ||||
| int isdata = tex->color_space == SHD_COLORSPACE_NONE; | int isdata = tex->color_space == SHD_COLORSPACE_NONE; | ||||
| float blend = tex->projection_blend; | float box_blend = tex->projection_blend; | ||||
| float use_alpha = (ima && (ima->flag & IMA_IGNORE_ALPHA) == 0); | |||||
| float extension = tex->extension; | |||||
| if (!ima) | if (!ima) | ||||
| return GPU_stack_link(mat, "node_tex_image_empty", in, out); | return GPU_stack_link(mat, "node_tex_image_empty", in, out); | ||||
| Context not available. | |||||
| switch (tex->projection) { | switch (tex->projection) { | ||||
| case SHD_PROJ_FLAT: | case SHD_PROJ_FLAT: | ||||
| GPU_stack_link(mat, "node_tex_image", in, out, GPU_image(ima, iuser, isdata)); | GPU_link(mat, "node_tex_image", in[0].link, | ||||
| GPU_image(ima, iuser, isdata), | |||||
| GPU_uniform(&use_alpha), | |||||
| GPU_uniform(&extension), | |||||
| &out[0].link, | |||||
| &out[1].link); | |||||
| break; | break; | ||||
| case SHD_PROJ_BOX: | case SHD_PROJ_BOX: | ||||
| GPU_link(mat, "direction_transform_m4v3", GPU_builtin(GPU_VIEW_NORMAL), | GPU_link(mat, "direction_transform_m4v3", GPU_builtin(GPU_VIEW_NORMAL), | ||||
| Context not available. | |||||
| GPU_link(mat, "node_tex_image_box", in[0].link, | GPU_link(mat, "node_tex_image_box", in[0].link, | ||||
| norm, | norm, | ||||
| GPU_image(ima, iuser, isdata), | GPU_image(ima, iuser, isdata), | ||||
| GPU_uniform(&blend), | GPU_uniform(&use_alpha), | ||||
| GPU_uniform(&extension), | |||||
| GPU_uniform(&box_blend), | |||||
| &out[0].link, | &out[0].link, | ||||
| &out[1].link); | &out[1].link); | ||||
| break; | break; | ||||
| case SHD_PROJ_SPHERE: | case SHD_PROJ_SPHERE: | ||||
| GPU_link(mat, "point_texco_remap_square", in[0].link, &in[0].link); | GPU_link(mat, "point_texco_remap_square", in[0].link, &in[0].link); | ||||
| GPU_link(mat, "point_map_to_sphere", in[0].link, &in[0].link); | GPU_link(mat, "point_map_to_sphere", in[0].link, &in[0].link); | ||||
| GPU_stack_link(mat, "node_tex_image", in, out, GPU_image(ima, iuser, isdata)); | GPU_link(mat, "node_tex_image", in[0].link, | ||||
| GPU_image(ima, iuser, isdata), | |||||
| GPU_uniform(&use_alpha), | |||||
| GPU_uniform(&extension), | |||||
| &out[0].link, | |||||
| &out[1].link); | |||||
| break; | break; | ||||
| case SHD_PROJ_TUBE: | case SHD_PROJ_TUBE: | ||||
| GPU_link(mat, "point_texco_remap_square", in[0].link, &in[0].link); | GPU_link(mat, "point_texco_remap_square", in[0].link, &in[0].link); | ||||
| GPU_link(mat, "point_map_to_tube", in[0].link, &in[0].link); | GPU_link(mat, "point_map_to_tube", in[0].link, &in[0].link); | ||||
| GPU_stack_link(mat, "node_tex_image", in, out, GPU_image(ima, iuser, isdata)); | GPU_link(mat, "node_tex_image", in[0].link, | ||||
| GPU_image(ima, iuser, isdata), | |||||
| GPU_uniform(&use_alpha), | |||||
| GPU_uniform(&extension), | |||||
| &out[0].link, | |||||
| &out[1].link); | |||||
| break; | break; | ||||
| } | } | ||||
| Context not available. | |||||