Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_outline.c
| Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | const bool do_expand = (U.pixelsize > 1.0) || (outline_width > 2.0f); | ||||
| pd->outlines_ptcloud_grp = grp = DRW_shgroup_create(sh_geom_ptcloud, psl->outlines_prepass_ps); | pd->outlines_ptcloud_grp = grp = DRW_shgroup_create(sh_geom_ptcloud, psl->outlines_prepass_ps); | ||||
| DRW_shgroup_uniform_bool_copy(grp, "isTransform", (G.moving & G_TRANSFORM_OBJ) != 0); | DRW_shgroup_uniform_bool_copy(grp, "isTransform", (G.moving & G_TRANSFORM_OBJ) != 0); | ||||
| GPUShader *sh_gpencil = OVERLAY_shader_outline_prepass_gpencil(); | GPUShader *sh_gpencil = OVERLAY_shader_outline_prepass_gpencil(); | ||||
| pd->outlines_gpencil_grp = grp = DRW_shgroup_create(sh_gpencil, psl->outlines_prepass_ps); | pd->outlines_gpencil_grp = grp = DRW_shgroup_create(sh_gpencil, psl->outlines_prepass_ps); | ||||
| DRW_shgroup_uniform_bool_copy(grp, "isTransform", (G.moving & G_TRANSFORM_OBJ) != 0); | DRW_shgroup_uniform_bool_copy(grp, "isTransform", (G.moving & G_TRANSFORM_OBJ) != 0); | ||||
| DRW_shgroup_uniform_float_copy(grp, "gpStrokeIndexOffset", 0.0); | DRW_shgroup_uniform_float_copy(grp, "gpStrokeIndexOffset", 0.0); | ||||
| GPUShader *sh_curves = OVERLAY_shader_outline_prepass_curves(); | |||||
| pd->outlines_curves_grp = grp = DRW_shgroup_create(sh_curves, psl->outlines_prepass_ps); | |||||
| DRW_shgroup_uniform_bool_copy(grp, "isTransform", (G.moving & G_TRANSFORM_OBJ) != 0); | |||||
| } | } | ||||
| /* outlines_prepass_ps is still needed for selection of probes. */ | /* outlines_prepass_ps is still needed for selection of probes. */ | ||||
| if (!(pd->v3d_flag & V3D_SELECT_OUTLINE)) { | if (!(pd->v3d_flag & V3D_SELECT_OUTLINE)) { | ||||
| return; | return; | ||||
| } | } | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | static void OVERLAY_outline_volume(OVERLAY_PrivateData *pd, Object *ob) | ||||
| if (geom == NULL) { | if (geom == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| DRWShadingGroup *shgroup = pd->outlines_grp; | DRWShadingGroup *shgroup = pd->outlines_grp; | ||||
| DRW_shgroup_call(shgroup, geom, ob); | DRW_shgroup_call(shgroup, geom, ob); | ||||
| } | } | ||||
| static void OVERLAY_outline_curves(OVERLAY_PrivateData *pd, Object *ob) | |||||
| { | |||||
| DRWShadingGroup *shgroup = pd->outlines_curves_grp; | |||||
| DRW_shgroup_curves_create_sub(ob, shgroup, NULL); | |||||
| } | |||||
| void OVERLAY_outline_cache_populate(OVERLAY_Data *vedata, | void OVERLAY_outline_cache_populate(OVERLAY_Data *vedata, | ||||
| Object *ob, | Object *ob, | ||||
| OVERLAY_DupliData *dupli, | OVERLAY_DupliData *dupli, | ||||
| bool init_dupli) | bool init_dupli) | ||||
| { | { | ||||
| OVERLAY_PrivateData *pd = vedata->stl->pd; | OVERLAY_PrivateData *pd = vedata->stl->pd; | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| struct GPUBatch *geom; | struct GPUBatch *geom; | ||||
| Show All 10 Lines | if (ob->type == OB_GPENCIL) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (ob->type == OB_VOLUME) { | if (ob->type == OB_VOLUME) { | ||||
| OVERLAY_outline_volume(pd, ob); | OVERLAY_outline_volume(pd, ob); | ||||
| return; | return; | ||||
| } | } | ||||
| if (ob->type == OB_CURVES) { | |||||
| OVERLAY_outline_curves(pd, ob); | |||||
| return; | |||||
| } | |||||
| if (ob->type == OB_POINTCLOUD && pd->wireframe_mode) { | if (ob->type == OB_POINTCLOUD && pd->wireframe_mode) { | ||||
| /* Looks bad in this case. Could be relaxed if we draw a | /* Looks bad in this case. Could be relaxed if we draw a | ||||
| * wireframe of some sort in the future. */ | * wireframe of some sort in the future. */ | ||||
| return; | return; | ||||
| } | } | ||||
| if (dupli && !init_dupli) { | if (dupli && !init_dupli) { | ||||
| geom = dupli->outline_geom; | geom = dupli->outline_geom; | ||||
| ▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines | |||||