Overlay Engine: Cleanup & enable line AA on in front passes
- Remove pd->view_default, was a leftover from TAA implementation - Sanitize active_view switches. - Sanitize framebuffers switches.
This commit is contained in:
parent
4949a62d4d
commit
1b33e1f9ae
Notes:
blender-bot
2023-02-14 05:01:20 +01:00
Referenced by issue #72574, Overlay: 'Show Cone' for Spotlights not working anymore Referenced by issue #72309, Crash on 'CTRL' or 'Command'+LMB in edit mode
|
@ -71,8 +71,6 @@ void OVERLAY_antialiasing_init(OVERLAY_Data *vedata)
|
|||
DRW_texture_ensure_2d(&txl->dummy_depth_tx, 1, 1, GPU_DEPTH_COMPONENT24, 0);
|
||||
|
||||
if (!DRW_state_is_fbo()) {
|
||||
/* Use default view */
|
||||
pd->view_default = (DRWView *)DRW_view_default_get();
|
||||
pd->antialiasing.enabled = false;
|
||||
return;
|
||||
}
|
||||
|
@ -81,35 +79,37 @@ void OVERLAY_antialiasing_init(OVERLAY_Data *vedata)
|
|||
/* TODO Get real userpref option and remove MSAA buffer. */
|
||||
pd->antialiasing.enabled = (dtxl->multisample_color != NULL) || need_wire_expansion;
|
||||
|
||||
/* Use default view */
|
||||
pd->view_default = (DRWView *)DRW_view_default_get();
|
||||
GPUTexture *color_tex = NULL;
|
||||
GPUTexture *line_tex = NULL;
|
||||
|
||||
if (pd->antialiasing.enabled) {
|
||||
DRW_texture_ensure_fullscreen_2d(&txl->overlay_color_tx, GPU_RGBA8, DRW_TEX_FILTER);
|
||||
DRW_texture_ensure_fullscreen_2d(&txl->overlay_line_tx, GPU_RGBA8, 0);
|
||||
|
||||
GPU_framebuffer_ensure_config(
|
||||
&fbl->overlay_color_only_fb,
|
||||
{GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(txl->overlay_color_tx)});
|
||||
GPU_framebuffer_ensure_config(
|
||||
&fbl->overlay_default_fb,
|
||||
{GPU_ATTACHMENT_TEXTURE(dtxl->depth), GPU_ATTACHMENT_TEXTURE(txl->overlay_color_tx)});
|
||||
GPU_framebuffer_ensure_config(&fbl->overlay_line_fb,
|
||||
{GPU_ATTACHMENT_TEXTURE(dtxl->depth),
|
||||
GPU_ATTACHMENT_TEXTURE(txl->overlay_color_tx),
|
||||
GPU_ATTACHMENT_TEXTURE(txl->overlay_line_tx)});
|
||||
color_tex = txl->overlay_color_tx;
|
||||
line_tex = txl->overlay_line_tx;
|
||||
}
|
||||
else {
|
||||
/* Just a copy of the defaults framebuffers. */
|
||||
GPU_framebuffer_ensure_config(&fbl->overlay_color_only_fb,
|
||||
{GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(dtxl->color)});
|
||||
GPU_framebuffer_ensure_config(
|
||||
&fbl->overlay_default_fb,
|
||||
{GPU_ATTACHMENT_TEXTURE(dtxl->depth), GPU_ATTACHMENT_TEXTURE(dtxl->color)});
|
||||
GPU_framebuffer_ensure_config(
|
||||
&fbl->overlay_line_fb,
|
||||
{GPU_ATTACHMENT_TEXTURE(dtxl->depth), GPU_ATTACHMENT_TEXTURE(dtxl->color)});
|
||||
color_tex = dtxl->color;
|
||||
}
|
||||
|
||||
GPU_framebuffer_ensure_config(&fbl->overlay_color_only_fb,
|
||||
{
|
||||
GPU_ATTACHMENT_NONE,
|
||||
GPU_ATTACHMENT_TEXTURE(color_tex),
|
||||
});
|
||||
GPU_framebuffer_ensure_config(&fbl->overlay_default_fb,
|
||||
{
|
||||
GPU_ATTACHMENT_TEXTURE(dtxl->depth),
|
||||
GPU_ATTACHMENT_TEXTURE(color_tex),
|
||||
});
|
||||
GPU_framebuffer_ensure_config(&fbl->overlay_line_fb,
|
||||
{
|
||||
GPU_ATTACHMENT_TEXTURE(dtxl->depth),
|
||||
GPU_ATTACHMENT_TEXTURE(color_tex),
|
||||
GPU_ATTACHMENT_TEXTURE(line_tex),
|
||||
});
|
||||
}
|
||||
|
||||
void OVERLAY_antialiasing_cache_init(OVERLAY_Data *vedata)
|
||||
|
@ -149,11 +149,21 @@ void OVERLAY_antialiasing_cache_finish(OVERLAY_Data *vedata)
|
|||
GPU_framebuffer_ensure_config(&fbl->overlay_in_front_fb,
|
||||
{GPU_ATTACHMENT_TEXTURE(dtxl->depth_in_front),
|
||||
GPU_ATTACHMENT_TEXTURE(txl->overlay_color_tx)});
|
||||
|
||||
GPU_framebuffer_ensure_config(&fbl->overlay_line_in_front_fb,
|
||||
{GPU_ATTACHMENT_TEXTURE(dtxl->depth_in_front),
|
||||
GPU_ATTACHMENT_TEXTURE(txl->overlay_color_tx),
|
||||
GPU_ATTACHMENT_TEXTURE(txl->overlay_line_tx)});
|
||||
}
|
||||
else {
|
||||
GPU_framebuffer_ensure_config(
|
||||
&fbl->overlay_in_front_fb,
|
||||
{GPU_ATTACHMENT_TEXTURE(dtxl->depth_in_front), GPU_ATTACHMENT_TEXTURE(dtxl->color)});
|
||||
|
||||
GPU_framebuffer_ensure_config(&fbl->overlay_line_in_front_fb,
|
||||
{GPU_ATTACHMENT_TEXTURE(dtxl->depth_in_front),
|
||||
GPU_ATTACHMENT_TEXTURE(dtxl->color),
|
||||
GPU_ATTACHMENT_TEXTURE(txl->overlay_line_tx)});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,8 +176,13 @@ void OVERLAY_antialiasing_start(OVERLAY_Data *vedata)
|
|||
float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
GPU_framebuffer_bind(fbl->overlay_line_fb);
|
||||
GPU_framebuffer_clear_color(fbl->overlay_line_fb, clear_col);
|
||||
}
|
||||
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
/* If we are not in solid shading mode, we clear the depth. */
|
||||
if (DRW_state_is_fbo() && pd->clear_in_front) {
|
||||
/* TODO(fclem) This clear should be done in a global place. */
|
||||
GPU_framebuffer_bind(fbl->overlay_in_front_fb);
|
||||
GPU_framebuffer_clear_depth(fbl->overlay_in_front_fb, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2331,14 +2331,20 @@ void OVERLAY_armature_in_front_draw(OVERLAY_Data *vedata)
|
|||
void OVERLAY_pose_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
|
||||
OVERLAY_FramebufferList *fbl = vedata->fbl;
|
||||
|
||||
if (psl->armature_bone_select_ps != NULL) {
|
||||
if (DRW_state_is_fbo()) {
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
}
|
||||
|
||||
DRW_draw_pass(psl->armature_bone_select_ps);
|
||||
|
||||
if (DRW_state_is_fbo()) {
|
||||
GPU_framebuffer_clear_depth(dfbl->default_fb, 1.0f);
|
||||
GPU_framebuffer_bind(fbl->overlay_line_in_front_fb);
|
||||
GPU_framebuffer_clear_depth(fbl->overlay_line_in_front_fb, 1.0f);
|
||||
}
|
||||
|
||||
/* Selection still works because we are drawing only the pose bones in this case. */
|
||||
|
||||
DRW_draw_pass(psl->armature_ps[1]);
|
||||
|
|
|
@ -119,6 +119,9 @@ void OVERLAY_edit_surf_cache_populate(OVERLAY_Data *vedata, Object *ob)
|
|||
void OVERLAY_edit_curve_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
OVERLAY_FramebufferList *fbl = vedata->fbl;
|
||||
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
|
||||
DRW_draw_pass(psl->edit_curve_wire_ps[0]);
|
||||
DRW_draw_pass(psl->edit_curve_wire_ps[1]);
|
||||
|
|
|
@ -46,7 +46,6 @@ void OVERLAY_edit_mesh_init(OVERLAY_Data *vedata)
|
|||
|
||||
/* Create view with depth offset */
|
||||
DRWView *default_view = (DRWView *)DRW_view_default_get();
|
||||
/* Don't use AA view (pd->view_default) because edit mode already has anti-aliasing. */
|
||||
pd->view_edit_faces = default_view;
|
||||
pd->view_edit_faces_cage = DRW_view_create_with_zoffset(default_view, draw_ctx->rv3d, 0.5f);
|
||||
pd->view_edit_edges = DRW_view_create_with_zoffset(default_view, draw_ctx->rv3d, 1.0f);
|
||||
|
@ -353,8 +352,6 @@ static void overlay_edit_mesh_draw_components(OVERLAY_PassList *psl,
|
|||
|
||||
DRW_view_set_active(pd->view_edit_verts);
|
||||
DRW_draw_pass(psl->edit_mesh_verts_ps[in_front]);
|
||||
|
||||
DRW_view_set_active(pd->view_default);
|
||||
}
|
||||
|
||||
void OVERLAY_edit_mesh_draw(OVERLAY_Data *vedata)
|
||||
|
@ -363,6 +360,8 @@ void OVERLAY_edit_mesh_draw(OVERLAY_Data *vedata)
|
|||
OVERLAY_PrivateData *pd = vedata->stl->pd;
|
||||
OVERLAY_FramebufferList *fbl = vedata->fbl;
|
||||
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
|
||||
DRW_draw_pass(psl->edit_mesh_weight_ps);
|
||||
DRW_draw_pass(psl->edit_mesh_analysis_ps);
|
||||
|
||||
|
@ -378,7 +377,7 @@ void OVERLAY_edit_mesh_draw(OVERLAY_Data *vedata)
|
|||
DRW_view_set_active(pd->view_edit_faces_cage);
|
||||
DRW_draw_pass(psl->edit_mesh_faces_cage_ps[NOT_IN_FRONT]);
|
||||
|
||||
DRW_view_set_active(pd->view_default);
|
||||
DRW_view_set_active(NULL);
|
||||
|
||||
GPU_framebuffer_bind(fbl->overlay_in_front_fb);
|
||||
GPU_framebuffer_clear_depth(fbl->overlay_in_front_fb, 1.0f);
|
||||
|
@ -389,8 +388,6 @@ void OVERLAY_edit_mesh_draw(OVERLAY_Data *vedata)
|
|||
|
||||
DRW_view_set_active(pd->view_edit_verts);
|
||||
DRW_draw_pass(psl->edit_mesh_verts_ps[NOT_IN_FRONT]);
|
||||
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
}
|
||||
else {
|
||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
|
|
|
@ -191,8 +191,10 @@ void OVERLAY_edit_text_cache_populate(OVERLAY_Data *vedata, Object *ob)
|
|||
void OVERLAY_edit_text_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
|
||||
|
||||
DRW_view_set_active(NULL);
|
||||
/* Text overlay need final color for color inversion. */
|
||||
GPU_framebuffer_bind(dfbl->default_fb);
|
||||
|
||||
DRW_draw_pass(psl->edit_text_wire_ps[0]);
|
||||
DRW_draw_pass(psl->edit_text_wire_ps[1]);
|
||||
|
|
|
@ -366,46 +366,51 @@ static void OVERLAY_draw_scene(void *vedata)
|
|||
OVERLAY_antialiasing_start(vedata);
|
||||
|
||||
DRW_view_set_active(NULL);
|
||||
|
||||
OVERLAY_outline_draw(vedata);
|
||||
|
||||
DRW_view_set_active(pd->view_default);
|
||||
if (DRW_state_is_fbo()) {
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
}
|
||||
|
||||
OVERLAY_image_draw(vedata);
|
||||
OVERLAY_facing_draw(vedata);
|
||||
|
||||
if (DRW_state_is_fbo()) {
|
||||
GPU_framebuffer_bind(fbl->overlay_line_fb);
|
||||
}
|
||||
|
||||
OVERLAY_wireframe_draw(vedata);
|
||||
OVERLAY_armature_draw(vedata);
|
||||
OVERLAY_particle_draw(vedata);
|
||||
OVERLAY_metaball_draw(vedata);
|
||||
OVERLAY_extra_draw(vedata);
|
||||
|
||||
DRW_view_set_active(NULL);
|
||||
if (DRW_state_is_fbo()) {
|
||||
GPU_framebuffer_bind(fbl->overlay_color_only_fb);
|
||||
}
|
||||
|
||||
OVERLAY_grid_draw(vedata);
|
||||
|
||||
DRW_view_set_active(pd->view_default);
|
||||
|
||||
if (DRW_state_is_fbo()) {
|
||||
GPU_framebuffer_bind(fbl->overlay_in_front_fb);
|
||||
|
||||
/* If we are not in solid shading mode, we clear the depth. */
|
||||
if (pd->clear_in_front) {
|
||||
/* TODO(fclem) This clear should be done in a global place. */
|
||||
GPU_framebuffer_clear_depth(fbl->overlay_in_front_fb, 1.0f);
|
||||
}
|
||||
GPU_framebuffer_bind(fbl->overlay_line_in_front_fb);
|
||||
}
|
||||
|
||||
OVERLAY_wireframe_in_front_draw(vedata);
|
||||
OVERLAY_armature_in_front_draw(vedata);
|
||||
OVERLAY_extra_in_front_draw(vedata);
|
||||
OVERLAY_metaball_in_front_draw(vedata);
|
||||
OVERLAY_image_in_front_draw(vedata);
|
||||
|
||||
if (DRW_state_is_fbo()) {
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
GPU_framebuffer_bind(fbl->overlay_color_only_fb);
|
||||
}
|
||||
|
||||
OVERLAY_image_in_front_draw(vedata);
|
||||
OVERLAY_motion_path_draw(vedata);
|
||||
OVERLAY_extra_centers_draw(vedata);
|
||||
|
||||
/* Functions after this point can change FBO freely. */
|
||||
|
||||
switch (pd->ctx_mode) {
|
||||
case CTX_MODE_EDIT_MESH:
|
||||
OVERLAY_edit_mesh_draw(vedata);
|
||||
|
@ -415,26 +420,20 @@ static void OVERLAY_draw_scene(void *vedata)
|
|||
OVERLAY_edit_curve_draw(vedata);
|
||||
break;
|
||||
case CTX_MODE_EDIT_TEXT:
|
||||
/* Text overlay need final color for color inversion. */
|
||||
OVERLAY_antialiasing_end(vedata);
|
||||
OVERLAY_edit_text_draw(vedata);
|
||||
return; /* WATCH! dont do AA twice. */
|
||||
break;
|
||||
case CTX_MODE_EDIT_LATTICE:
|
||||
OVERLAY_edit_lattice_draw(vedata);
|
||||
break;
|
||||
case CTX_MODE_POSE:
|
||||
/* Pain overlay needs final color because of multiply blend mode. */
|
||||
OVERLAY_antialiasing_end(vedata);
|
||||
OVERLAY_paint_draw(vedata);
|
||||
OVERLAY_pose_draw(vedata);
|
||||
return; /* WATCH! dont do AA twice. */
|
||||
break;
|
||||
case CTX_MODE_PAINT_WEIGHT:
|
||||
case CTX_MODE_PAINT_VERTEX:
|
||||
case CTX_MODE_PAINT_TEXTURE:
|
||||
/* Pain overlay need final color because of multiply blend mode. */
|
||||
OVERLAY_antialiasing_end(vedata);
|
||||
OVERLAY_paint_draw(vedata);
|
||||
return; /* WATCH! dont do AA twice. */
|
||||
break;
|
||||
case CTX_MODE_PARTICLE:
|
||||
OVERLAY_edit_particle_draw(vedata);
|
||||
break;
|
||||
|
|
|
@ -1600,30 +1600,19 @@ void OVERLAY_extra_cache_populate(OVERLAY_Data *vedata, Object *ob)
|
|||
}
|
||||
}
|
||||
|
||||
void OVERLAY_extra_blend_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
DRW_draw_pass(vedata->psl->extra_blend_ps);
|
||||
}
|
||||
|
||||
void OVERLAY_extra_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
OVERLAY_FramebufferList *fbl = vedata->fbl;
|
||||
OVERLAY_PrivateData *pd = vedata->stl->pd;
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
|
||||
DRW_draw_pass(psl->extra_blend_ps);
|
||||
|
||||
if (pd->antialiasing.enabled) {
|
||||
GPU_framebuffer_bind(fbl->overlay_line_fb);
|
||||
}
|
||||
|
||||
DRW_draw_pass(psl->extra_ps[0]);
|
||||
|
||||
if (pd->antialiasing.enabled) {
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
}
|
||||
DRW_draw_pass(vedata->psl->extra_ps[0]);
|
||||
}
|
||||
|
||||
void OVERLAY_extra_in_front_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
|
||||
DRW_draw_pass(psl->extra_ps[1]);
|
||||
DRW_draw_pass(vedata->psl->extra_ps[1]);
|
||||
|
||||
OVERLAY_volume_free_smoke_textures(vedata);
|
||||
}
|
||||
|
@ -1633,14 +1622,6 @@ void OVERLAY_extra_centers_draw(OVERLAY_Data *vedata)
|
|||
OVERLAY_FramebufferList *fbl = vedata->fbl;
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
|
||||
if (DRW_state_is_fbo()) {
|
||||
GPU_framebuffer_bind(fbl->overlay_color_only_fb);
|
||||
}
|
||||
|
||||
DRW_draw_pass(psl->extra_grid_ps);
|
||||
DRW_draw_pass(psl->extra_centers_ps);
|
||||
|
||||
if (DRW_state_is_fbo()) {
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,12 +53,6 @@ void OVERLAY_facing_cache_populate(OVERLAY_Data *vedata, Object *ob)
|
|||
void OVERLAY_facing_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
OVERLAY_PrivateData *pd = vedata->stl->pd;
|
||||
|
||||
/* We need to match underlying geometry pass, at the cost of bypassing TAA. */
|
||||
DRW_view_set_active(NULL);
|
||||
|
||||
DRW_draw_pass(psl->facing_ps);
|
||||
|
||||
DRW_view_set_active(pd->view_default);
|
||||
}
|
||||
|
|
|
@ -212,9 +212,6 @@ void OVERLAY_grid_draw(OVERLAY_Data *vedata)
|
|||
OVERLAY_FramebufferList *fbl = vedata->fbl;
|
||||
|
||||
if (psl->grid_ps) {
|
||||
GPU_framebuffer_bind(fbl->overlay_color_only_fb);
|
||||
DRW_draw_pass(psl->grid_ps);
|
||||
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ void OVERLAY_image_init(OVERLAY_Data *vedata)
|
|||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
OVERLAY_PrivateData *pd = vedata->stl->pd;
|
||||
|
||||
pd->view_reference_images = DRW_view_create_with_zoffset(
|
||||
pd->view_default, draw_ctx->rv3d, -1.0f);
|
||||
DRWView *default_view = (DRWView *)DRW_view_default_get();
|
||||
pd->view_reference_images = DRW_view_create_with_zoffset(default_view, draw_ctx->rv3d, -1.0f);
|
||||
}
|
||||
|
||||
void OVERLAY_image_cache_init(OVERLAY_Data *vedata)
|
||||
|
@ -451,7 +451,7 @@ void OVERLAY_image_draw(OVERLAY_Data *vedata)
|
|||
DRW_draw_pass(psl->image_empties_ps);
|
||||
DRW_draw_pass(psl->image_empties_blend_ps);
|
||||
|
||||
DRW_view_set_active(pd->view_default);
|
||||
DRW_view_set_active(NULL);
|
||||
}
|
||||
|
||||
void OVERLAY_image_in_front_draw(OVERLAY_Data *vedata)
|
||||
|
@ -464,7 +464,7 @@ void OVERLAY_image_in_front_draw(OVERLAY_Data *vedata)
|
|||
DRW_draw_pass(psl->image_empties_front_ps);
|
||||
DRW_draw_pass(psl->image_foreground_ps);
|
||||
|
||||
DRW_view_set_active(pd->view_default);
|
||||
DRW_view_set_active(NULL);
|
||||
|
||||
OVERLAY_image_free_movieclips_textures(vedata);
|
||||
}
|
||||
|
|
|
@ -73,6 +73,9 @@ void OVERLAY_lattice_cache_populate(OVERLAY_Data *vedata, Object *ob)
|
|||
void OVERLAY_edit_lattice_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
OVERLAY_FramebufferList *fbl = vedata->fbl;
|
||||
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
|
||||
DRW_draw_pass(psl->edit_lattice_ps);
|
||||
}
|
||||
|
|
|
@ -202,9 +202,15 @@ void OVERLAY_paint_weight_cache_populate(OVERLAY_Data *vedata, Object *ob)
|
|||
void OVERLAY_paint_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
OVERLAY_FramebufferList *fbl = vedata->fbl;
|
||||
DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
|
||||
|
||||
if (DRW_state_is_fbo()) {
|
||||
/* Pain overlay needs final color because of multiply blend mode. */
|
||||
GPU_framebuffer_bind(dfbl->default_fb);
|
||||
}
|
||||
|
||||
if (psl->paint_color_ps) {
|
||||
DRW_view_set_active(NULL);
|
||||
DRW_draw_pass(psl->paint_color_ps);
|
||||
}
|
||||
DRW_draw_pass(psl->paint_overlay_ps);
|
||||
|
|
|
@ -120,6 +120,9 @@ void OVERLAY_edit_particle_cache_populate(OVERLAY_Data *vedata, Object *ob)
|
|||
void OVERLAY_edit_particle_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
OVERLAY_FramebufferList *fbl = vedata->fbl;
|
||||
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
|
||||
DRW_draw_pass(psl->edit_particle_ps);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ typedef struct OVERLAY_FramebufferList {
|
|||
struct GPUFrameBuffer *overlay_line_fb;
|
||||
struct GPUFrameBuffer *overlay_color_only_fb;
|
||||
struct GPUFrameBuffer *overlay_in_front_fb;
|
||||
struct GPUFrameBuffer *overlay_line_in_front_fb;
|
||||
struct GPUFrameBuffer *outlines_prepass_fb;
|
||||
struct GPUFrameBuffer *outlines_resolve_fb;
|
||||
} OVERLAY_FramebufferList;
|
||||
|
@ -44,7 +45,6 @@ typedef struct OVERLAY_TextureList {
|
|||
struct GPUTexture *outlines_id_tx;
|
||||
struct GPUTexture *overlay_color_tx;
|
||||
struct GPUTexture *overlay_line_tx;
|
||||
struct GPUTexture *edit_mesh_occlude_wire_tx;
|
||||
} OVERLAY_TextureList;
|
||||
|
||||
#define NOT_IN_FRONT 0
|
||||
|
@ -423,6 +423,7 @@ void OVERLAY_edit_particle_draw(OVERLAY_Data *vedata);
|
|||
|
||||
void OVERLAY_extra_cache_init(OVERLAY_Data *vedata);
|
||||
void OVERLAY_extra_cache_populate(OVERLAY_Data *vedata, Object *ob);
|
||||
void OVERLAY_extra_blend_draw(OVERLAY_Data *vedata);
|
||||
void OVERLAY_extra_draw(OVERLAY_Data *vedata);
|
||||
void OVERLAY_extra_in_front_draw(OVERLAY_Data *vedata);
|
||||
void OVERLAY_extra_centers_draw(OVERLAY_Data *vedata);
|
||||
|
|
|
@ -60,6 +60,9 @@ void OVERLAY_sculpt_cache_populate(OVERLAY_Data *vedata, Object *ob)
|
|||
void OVERLAY_sculpt_draw(OVERLAY_Data *vedata)
|
||||
{
|
||||
OVERLAY_PassList *psl = vedata->psl;
|
||||
OVERLAY_FramebufferList *fbl = vedata->fbl;
|
||||
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
|
||||
DRW_draw_pass(psl->sculpt_mask_ps);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,8 @@ void OVERLAY_wireframe_init(OVERLAY_Data *vedata)
|
|||
{
|
||||
OVERLAY_PrivateData *pd = vedata->stl->pd;
|
||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
pd->view_wires = DRW_view_create_with_zoffset(pd->view_default, draw_ctx->rv3d, 0.5f);
|
||||
DRWView *default_view = (DRWView *)DRW_view_default_get();
|
||||
pd->view_wires = DRW_view_create_with_zoffset(default_view, draw_ctx->rv3d, 0.5f);
|
||||
}
|
||||
|
||||
void OVERLAY_wireframe_cache_init(OVERLAY_Data *vedata)
|
||||
|
@ -221,22 +222,13 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
|
|||
|
||||
void OVERLAY_wireframe_draw(OVERLAY_Data *data)
|
||||
{
|
||||
OVERLAY_FramebufferList *fbl = data->fbl;
|
||||
OVERLAY_PassList *psl = data->psl;
|
||||
OVERLAY_PrivateData *pd = data->stl->pd;
|
||||
|
||||
if (pd->antialiasing.enabled) {
|
||||
GPU_framebuffer_bind(fbl->overlay_line_fb);
|
||||
}
|
||||
|
||||
DRW_view_set_active(pd->view_wires);
|
||||
DRW_draw_pass(psl->wireframe_ps);
|
||||
|
||||
DRW_view_set_active(pd->view_default);
|
||||
|
||||
if (pd->antialiasing.enabled) {
|
||||
GPU_framebuffer_bind(fbl->overlay_default_fb);
|
||||
}
|
||||
DRW_view_set_active(NULL);
|
||||
}
|
||||
|
||||
void OVERLAY_wireframe_in_front_draw(OVERLAY_Data *data)
|
||||
|
@ -247,5 +239,5 @@ void OVERLAY_wireframe_in_front_draw(OVERLAY_Data *data)
|
|||
DRW_view_set_active(pd->view_wires);
|
||||
DRW_draw_pass(psl->wireframe_xray_ps);
|
||||
|
||||
DRW_view_set_active(pd->view_default);
|
||||
DRW_view_set_active(NULL);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue