Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_paint.c
| Show All 22 Lines | |||||
| #include "DRW_render.h" | #include "DRW_render.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "overlay_private.h" | #include "overlay_private.h" | ||||
| void OVERLAY_paint_init(OVERLAY_Data *vedata) | |||||
| { | |||||
| OVERLAY_StorageList *stl = vedata->stl; | |||||
| OVERLAY_PrivateData *pd = stl->pd; | |||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | |||||
| pd->painting.in_front = draw_ctx->obact && (draw_ctx->obact->dtx & OB_DRAWXRAY); | |||||
| } | |||||
| void OVERLAY_paint_cache_init(OVERLAY_Data *vedata) | void OVERLAY_paint_cache_init(OVERLAY_Data *vedata) | ||||
| { | { | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| OVERLAY_PassList *psl = vedata->psl; | OVERLAY_PassList *psl = vedata->psl; | ||||
| OVERLAY_PrivateData *pd = vedata->stl->pd; | OVERLAY_PrivateData *pd = vedata->stl->pd; | ||||
| struct GPUShader *sh; | struct GPUShader *sh; | ||||
| DRWShadingGroup *grp; | DRWShadingGroup *grp; | ||||
| DRWState state; | DRWState state; | ||||
| ▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | |||||
| void OVERLAY_paint_weight_cache_populate(OVERLAY_Data *vedata, Object *ob) | void OVERLAY_paint_weight_cache_populate(OVERLAY_Data *vedata, Object *ob) | ||||
| { | { | ||||
| OVERLAY_paint_vertex_cache_populate(vedata, ob); | OVERLAY_paint_vertex_cache_populate(vedata, ob); | ||||
| } | } | ||||
| void OVERLAY_paint_draw(OVERLAY_Data *vedata) | void OVERLAY_paint_draw(OVERLAY_Data *vedata) | ||||
| { | { | ||||
| OVERLAY_StorageList *stl = vedata->stl; | |||||
| OVERLAY_PrivateData *pd = stl->pd; | |||||
| OVERLAY_PassList *psl = vedata->psl; | OVERLAY_PassList *psl = vedata->psl; | ||||
| DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); | DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); | ||||
| if (DRW_state_is_fbo()) { | if (DRW_state_is_fbo()) { | ||||
| /* Pain overlay needs final color because of multiply blend mode. */ | /* Pain overlay needs final color because of multiply blend mode. */ | ||||
| GPU_framebuffer_bind(dfbl->default_fb); | GPU_framebuffer_bind(pd->painting.in_front ? dfbl->in_front_fb : dfbl->default_fb); | ||||
| } | } | ||||
| if (psl->paint_color_ps) { | if (psl->paint_color_ps) { | ||||
| DRW_draw_pass(psl->paint_color_ps); | DRW_draw_pass(psl->paint_color_ps); | ||||
| } | } | ||||
| DRW_draw_pass(psl->paint_overlay_ps); | DRW_draw_pass(psl->paint_overlay_ps); | ||||
| } | } | ||||