Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_materials.c
| Show First 20 Lines • Show All 370 Lines • ▼ Show 20 Lines | void workbench_material_shgroup_uniform(WORKBENCH_PrivateData *wpd, | ||||
| } | } | ||||
| const bool use_highlight = workbench_is_specular_highlight_enabled(wpd); | const bool use_highlight = workbench_is_specular_highlight_enabled(wpd); | ||||
| const bool use_texture = (V3D_SHADING_TEXTURE_COLOR == workbench_material_determine_color_type( | const bool use_texture = (V3D_SHADING_TEXTURE_COLOR == workbench_material_determine_color_type( | ||||
| wpd, material->ima, ob, false)); | wpd, material->ima, ob, false)); | ||||
| if (use_texture) { | if (use_texture) { | ||||
| if (is_tiled) { | if (is_tiled) { | ||||
| GPUTexture *array_tex = GPU_texture_from_blender( | GPUTexture *array_tex = GPU_texture_from_blender( | ||||
| material->ima, material->iuser, GL_TEXTURE_2D_ARRAY); | material->ima, material->iuser, NULL, GL_TEXTURE_2D_ARRAY); | ||||
| GPUTexture *data_tex = GPU_texture_from_blender( | GPUTexture *data_tex = GPU_texture_from_blender( | ||||
| material->ima, material->iuser, GL_TEXTURE_1D_ARRAY); | material->ima, material->iuser, NULL, GL_TEXTURE_1D_ARRAY); | ||||
| DRW_shgroup_uniform_texture(grp, "image_tile_array", array_tex); | DRW_shgroup_uniform_texture(grp, "image_tile_array", array_tex); | ||||
| DRW_shgroup_uniform_texture(grp, "image_tile_data", data_tex); | DRW_shgroup_uniform_texture(grp, "image_tile_data", data_tex); | ||||
| } | } | ||||
| else { | else { | ||||
| GPUTexture *tex = GPU_texture_from_blender(material->ima, material->iuser, GL_TEXTURE_2D); | GPUTexture *tex = GPU_texture_from_blender( | ||||
| material->ima, material->iuser, NULL, GL_TEXTURE_2D); | |||||
| DRW_shgroup_uniform_texture(grp, "image", tex); | DRW_shgroup_uniform_texture(grp, "image", tex); | ||||
| } | } | ||||
| DRW_shgroup_uniform_bool_copy( | DRW_shgroup_uniform_bool_copy( | ||||
| grp, "imagePremultiplied", (material->ima->alpha_mode == IMA_ALPHA_PREMUL)); | grp, "imagePremultiplied", (material->ima->alpha_mode == IMA_ALPHA_PREMUL)); | ||||
| DRW_shgroup_uniform_bool_copy(grp, "imageNearest", (interp == SHD_INTERP_CLOSEST)); | DRW_shgroup_uniform_bool_copy(grp, "imageNearest", (interp == SHD_INTERP_CLOSEST)); | ||||
| } | } | ||||
| DRW_shgroup_uniform_vec4(grp, "materialColorAndMetal", material->base_color, 1); | DRW_shgroup_uniform_vec4(grp, "materialColorAndMetal", material->base_color, 1); | ||||
| Show All 15 Lines | |||||