Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_materials.c
| Show First 20 Lines • Show All 2,067 Lines • ▼ Show 20 Lines | if ((ob->dt >= OB_SOLID) || DRW_state_is_image_render()) { | ||||
| /* Get per-material split surface */ | /* Get per-material split surface */ | ||||
| struct GPUBatch **mat_geom = NULL; | struct GPUBatch **mat_geom = NULL; | ||||
| if (!use_sculpt_pbvh) { | if (!use_sculpt_pbvh) { | ||||
| mat_geom = DRW_cache_object_surface_material_get(ob, gpumat_array, materials_len); | mat_geom = DRW_cache_object_surface_material_get(ob, gpumat_array, materials_len); | ||||
| } | } | ||||
| if (use_sculpt_pbvh) { | if (use_sculpt_pbvh) { | ||||
| /* Vcol is not supported in the modes that require PBVH drawing. */ | |||||
| const bool use_vcol = false; | |||||
| struct DRWShadingGroup **sculpt_shgrps_array = BLI_array_alloca(sculpt_shgrps_array, | struct DRWShadingGroup **sculpt_shgrps_array = BLI_array_alloca(sculpt_shgrps_array, | ||||
| materials_len); | materials_len); | ||||
| for (int i = 0; i < materials_len; i++) { | for (int i = 0; i < materials_len; i++) { | ||||
| sculpt_shgrps_array[i] = shgrps_array[i].shading_grp; | sculpt_shgrps_array[i] = shgrps_array[i].shading_grp; | ||||
| } | } | ||||
| DRW_shgroup_call_sculpt_with_materials(sculpt_shgrps_array, materials_len, ob, use_vcol); | DRW_shgroup_call_sculpt_with_materials(sculpt_shgrps_array, materials_len, ob); | ||||
| for (int i = 0; i < materials_len; i++) { | for (int i = 0; i < materials_len; i++) { | ||||
| sculpt_shgrps_array[i] = shgrps_array[i].depth_grp; | sculpt_shgrps_array[i] = shgrps_array[i].depth_grp; | ||||
| } | } | ||||
| DRW_shgroup_call_sculpt_with_materials(sculpt_shgrps_array, materials_len, ob, use_vcol); | DRW_shgroup_call_sculpt_with_materials(sculpt_shgrps_array, materials_len, ob); | ||||
| for (int i = 0; i < materials_len; i++) { | for (int i = 0; i < materials_len; i++) { | ||||
| sculpt_shgrps_array[i] = shgrps_array[i].depth_clip_grp; | sculpt_shgrps_array[i] = shgrps_array[i].depth_clip_grp; | ||||
| } | } | ||||
| DRW_shgroup_call_sculpt_with_materials(sculpt_shgrps_array, materials_len, ob, use_vcol); | DRW_shgroup_call_sculpt_with_materials(sculpt_shgrps_array, materials_len, ob); | ||||
| for (int renderpass_index = 0; | for (int renderpass_index = 0; | ||||
| renderpass_index < stl->g_data->render_passes_material_count; | renderpass_index < stl->g_data->render_passes_material_count; | ||||
| renderpass_index++) { | renderpass_index++) { | ||||
| for (int i = 0; i < materials_len; i++) { | for (int i = 0; i < materials_len; i++) { | ||||
| sculpt_shgrps_array[i] = shgrps_array[i].material_accum_grp[renderpass_index]; | sculpt_shgrps_array[i] = shgrps_array[i].material_accum_grp[renderpass_index]; | ||||
| } | } | ||||
| DRW_shgroup_call_sculpt_with_materials(sculpt_shgrps_array, materials_len, ob, use_vcol); | DRW_shgroup_call_sculpt_with_materials(sculpt_shgrps_array, materials_len, ob); | ||||
| } | } | ||||
| /* TODO(fclem): Support shadows in sculpt mode. */ | /* TODO(fclem): Support shadows in sculpt mode. */ | ||||
| } | } | ||||
| else if (mat_geom) { | else if (mat_geom) { | ||||
| for (int i = 0; i < materials_len; i++) { | for (int i = 0; i < materials_len; i++) { | ||||
| if (mat_geom[i] == NULL) { | if (mat_geom[i] == NULL) { | ||||
| continue; | continue; | ||||
| ▲ Show 20 Lines • Show All 321 Lines • Show Last 20 Lines | |||||