Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_deferred.c
| Show First 20 Lines • Show All 818 Lines • ▼ Show 20 Lines | if (material == NULL) { | ||||
| material = MEM_mallocN(sizeof(WORKBENCH_MaterialData), __func__); | material = MEM_mallocN(sizeof(WORKBENCH_MaterialData), __func__); | ||||
| material->shgrp = DRW_shgroup_create( | material->shgrp = DRW_shgroup_create( | ||||
| (color_type == V3D_SHADING_TEXTURE_COLOR) ? wpd->prepass_texture_sh: wpd->prepass_solid_sh, | (color_type == V3D_SHADING_TEXTURE_COLOR) ? wpd->prepass_texture_sh: wpd->prepass_solid_sh, | ||||
| (ob->dtx & OB_DRAWXRAY) ? psl->ghost_prepass_pass : psl->prepass_pass); | (ob->dtx & OB_DRAWXRAY) ? psl->ghost_prepass_pass : psl->prepass_pass); | ||||
| workbench_material_copy(material, &material_template); | workbench_material_copy(material, &material_template); | ||||
| DRW_shgroup_stencil_mask(material->shgrp, (ob->dtx & OB_DRAWXRAY) ? 0x00 : 0xFF); | DRW_shgroup_stencil_mask(material->shgrp, (ob->dtx & OB_DRAWXRAY) ? 0x00 : 0xFF); | ||||
| DRW_shgroup_uniform_int(material->shgrp, "object_id", &material->object_id, 1); | DRW_shgroup_uniform_int(material->shgrp, "object_id", &material->object_id, 1); | ||||
| workbench_material_shgroup_uniform(wpd, material->shgrp, material, ob, true, true, interp); | workbench_material_shgroup_uniform(wpd, material->shgrp, material, ob, true, true, interp); | ||||
| if (wpd->world_clip_planes) { | if (WORLD_CLIPPING_ENABLED(wpd)) { | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| RegionView3D *rv3d = draw_ctx->rv3d; | RegionView3D *rv3d = draw_ctx->rv3d; | ||||
| DRW_shgroup_world_clip_planes_from_rv3d(material->shgrp, rv3d); | DRW_shgroup_world_clip_planes_from_rv3d(material->shgrp, rv3d); | ||||
| } | } | ||||
| BLI_ghash_insert(wpd->material_hash, POINTER_FROM_UINT(hash), material); | BLI_ghash_insert(wpd->material_hash, POINTER_FROM_UINT(hash), material); | ||||
| } | } | ||||
| return material; | return material; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 376 Lines • Show Last 20 Lines | |||||