Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_engine.c
| Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
| static void workbench_cache_sculpt_populate(WORKBENCH_PrivateData *wpd, | static void workbench_cache_sculpt_populate(WORKBENCH_PrivateData *wpd, | ||||
| Object *ob, | Object *ob, | ||||
| eV3DShadingColorType color_type) | eV3DShadingColorType color_type) | ||||
| { | { | ||||
| const bool use_single_drawcall = !ELEM(color_type, V3D_SHADING_MATERIAL_COLOR); | const bool use_single_drawcall = !ELEM(color_type, V3D_SHADING_MATERIAL_COLOR); | ||||
| if (use_single_drawcall) { | if (use_single_drawcall) { | ||||
| DRWShadingGroup *grp = workbench_material_setup(wpd, ob, ob->actcol, color_type, NULL); | DRWShadingGroup *grp = workbench_material_setup(wpd, ob, ob->actcol, color_type, NULL); | ||||
| DRW_shgroup_call_sculpt(grp, ob, false, false); | |||||
| bool use_color = color_type == V3D_SHADING_VERTEX_COLOR; | |||||
| bool use_uv = color_type == V3D_SHADING_TEXTURE_COLOR; | |||||
| DRW_shgroup_call_sculpt(grp, ob, false, false, false, use_color, use_uv); | |||||
| } | } | ||||
| else { | else { | ||||
| const int materials_len = DRW_cache_object_material_count_get(ob); | const int materials_len = DRW_cache_object_material_count_get(ob); | ||||
| struct DRWShadingGroup **shgrps = BLI_array_alloca(shgrps, materials_len); | struct DRWShadingGroup **shgrps = BLI_array_alloca(shgrps, materials_len); | ||||
| for (int i = 0; i < materials_len; i++) { | for (int i = 0; i < materials_len; i++) { | ||||
| shgrps[i] = workbench_material_setup(wpd, ob, i + 1, color_type, NULL); | shgrps[i] = workbench_material_setup(wpd, ob, i + 1, color_type, NULL); | ||||
| } | } | ||||
| DRW_shgroup_call_sculpt_with_materials(shgrps, materials_len, ob); | DRW_shgroup_call_sculpt_with_materials(shgrps, NULL, materials_len, ob); | ||||
| } | } | ||||
| } | } | ||||
| BLI_INLINE void workbench_object_drawcall(DRWShadingGroup *grp, struct GPUBatch *geom, Object *ob) | BLI_INLINE void workbench_object_drawcall(DRWShadingGroup *grp, struct GPUBatch *geom, Object *ob) | ||||
| { | { | ||||
| if (ob->type == OB_POINTCLOUD) { | if (ob->type == OB_POINTCLOUD) { | ||||
| /* Draw range to avoid drawcall batching messing up the instance attribute. */ | /* Draw range to avoid drawcall batching messing up the instance attribute. */ | ||||
| DRW_shgroup_call_instance_range(grp, ob, geom, 0, 0); | DRW_shgroup_call_instance_range(grp, ob, geom, 0, 0); | ||||
| ▲ Show 20 Lines • Show All 572 Lines • Show Last 20 Lines | |||||