Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_materials.c
| Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | BLI_INLINE void workbench_material_get_image( | ||||
| bNode *node; | bNode *node; | ||||
| *r_sampler = 0; | *r_sampler = 0; | ||||
| ED_object_get_active_image(ob, mat_nr, r_image, r_iuser, &node, NULL); | ED_object_get_active_image(ob, mat_nr, r_image, r_iuser, &node, NULL); | ||||
| if (node && *r_image) { | if (node && *r_image) { | ||||
| switch (node->type) { | switch (node->type) { | ||||
| case SH_NODE_TEX_IMAGE: { | case SH_NODE_TEX_IMAGE: { | ||||
| NodeTexImage *storage = node->storage; | NodeTexImage *storage = node->storage; | ||||
| const bool use_filter = (storage->interpolation != SHD_INTERP_CLOSEST); | const bool use_filter = (storage->interpolation != IMAGE_TEX_INTERP_CLOSEST); | ||||
| const bool use_repeat = (storage->extension == SHD_IMAGE_EXTENSION_REPEAT); | const bool use_repeat = (storage->extension == IMAGE_TEX_EXT_REPEAT); | ||||
| const bool use_clip = (storage->extension == SHD_IMAGE_EXTENSION_CLIP); | const bool use_clip = (storage->extension == IMAGE_TEX_EXT_CLIP); | ||||
| SET_FLAG_FROM_TEST(*r_sampler, use_filter, GPU_SAMPLER_FILTER); | SET_FLAG_FROM_TEST(*r_sampler, use_filter, GPU_SAMPLER_FILTER); | ||||
| SET_FLAG_FROM_TEST(*r_sampler, use_repeat, GPU_SAMPLER_REPEAT); | SET_FLAG_FROM_TEST(*r_sampler, use_repeat, GPU_SAMPLER_REPEAT); | ||||
| SET_FLAG_FROM_TEST(*r_sampler, use_clip, GPU_SAMPLER_CLAMP_BORDER); | SET_FLAG_FROM_TEST(*r_sampler, use_clip, GPU_SAMPLER_CLAMP_BORDER); | ||||
| break; | break; | ||||
| } | } | ||||
| case SH_NODE_TEX_ENVIRONMENT: { | case SH_NODE_TEX_ENVIRONMENT: { | ||||
| NodeTexEnvironment *storage = node->storage; | NodeTexEnvironment *storage = node->storage; | ||||
| const bool use_filter = (storage->interpolation != SHD_INTERP_CLOSEST); | const bool use_filter = (storage->interpolation != IMAGE_TEX_INTERP_CLOSEST); | ||||
| SET_FLAG_FROM_TEST(*r_sampler, use_filter, GPU_SAMPLER_FILTER); | SET_FLAG_FROM_TEST(*r_sampler, use_filter, GPU_SAMPLER_FILTER); | ||||
| break; | break; | ||||
| } | } | ||||
| default: | default: | ||||
| BLI_assert_msg(0, "Node type not supported by workbench"); | BLI_assert_msg(0, "Node type not supported by workbench"); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines | |||||