Fix #103244: ghosting in Eevee with sculpt paint brush and canvas #104557
|
@ -253,9 +253,11 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
|
|||
|
||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
|
||||
bool painting = false;
|
||||
|
||||
if (draw_ctx->rv3d)
|
||||
painting = draw_ctx->rv3d->rflag & RV3D_PAINTING;
|
||||
|
||||
if (((scene_eval->eevee.taa_samples != 1) || DRW_state_is_image_render()) &&
|
||||
!(draw_ctx->region->do_draw & RGN_DRAW_SINGLE_SAMPLE)) {
|
||||
if (((scene_eval->eevee.taa_samples != 1) || DRW_state_is_image_render()) && !painting) {
|
||||
float persmat[4][4];
|
||||
|
||||
if (!DRW_state_is_image_render() && (scene_eval->eevee.flag & SCE_EEVEE_TAA_REPROJECTION)) {
|
||||
|
|
|
@ -71,7 +71,6 @@ void ED_region_update_rect(struct ARegion *region);
|
|||
*/
|
||||
void ED_region_floating_init(struct ARegion *region);
|
||||
void ED_region_tag_redraw(struct ARegion *region);
|
||||
void ED_region_tag_redraw_force_single_sample(struct ARegion *region);
|
||||
void ED_region_tag_redraw_partial(struct ARegion *region, const struct rcti *rct, bool rebuild);
|
||||
void ED_region_tag_redraw_cursor(struct ARegion *region);
|
||||
void ED_region_tag_redraw_no_rebuild(struct ARegion *region);
|
||||
|
|
|
@ -658,21 +658,12 @@ void ED_region_tag_redraw(ARegion *region)
|
|||
* but python scripts can cause this to happen indirectly */
|
||||
if (region && !(region->do_draw & RGN_DRAWING)) {
|
||||
/* zero region means full region redraw */
|
||||
region->do_draw &= ~(RGN_DRAW_PARTIAL | RGN_DRAW_NO_REBUILD | RGN_DRAW_EDITOR_OVERLAYS |
|
||||
RGN_DRAW_SINGLE_SAMPLE);
|
||||
region->do_draw &= ~(RGN_DRAW_PARTIAL | RGN_DRAW_NO_REBUILD | RGN_DRAW_EDITOR_OVERLAYS);
|
||||
region->do_draw |= RGN_DRAW;
|
||||
memset(®ion->drawrct, 0, sizeof(region->drawrct));
|
||||
}
|
||||
}
|
||||
|
||||
void ED_region_tag_redraw_force_single_sample(ARegion *region)
|
||||
{
|
||||
if (region && !(region->do_draw & RGN_DRAWING)) {
|
||||
ED_region_tag_redraw(region);
|
||||
region->do_draw |= RGN_DRAW_SINGLE_SAMPLE;
|
||||
}
|
||||
}
|
||||
|
||||
void ED_region_tag_redraw_cursor(ARegion *region)
|
||||
{
|
||||
if (region) {
|
||||
|
@ -683,7 +674,7 @@ void ED_region_tag_redraw_cursor(ARegion *region)
|
|||
void ED_region_tag_redraw_no_rebuild(ARegion *region)
|
||||
{
|
||||
if (region && !(region->do_draw & (RGN_DRAWING | RGN_DRAW))) {
|
||||
region->do_draw &= ~(RGN_DRAW_PARTIAL | RGN_DRAW_EDITOR_OVERLAYS | RGN_DRAW_SINGLE_SAMPLE);
|
||||
region->do_draw &= ~(RGN_DRAW_PARTIAL | RGN_DRAW_EDITOR_OVERLAYS);
|
||||
region->do_draw |= RGN_DRAW_NO_REBUILD;
|
||||
memset(®ion->drawrct, 0, sizeof(region->drawrct));
|
||||
}
|
||||
|
|
|
@ -5470,7 +5470,7 @@ void SCULPT_flush_update_step(bContext *C, SculptUpdateType update_flags)
|
|||
}
|
||||
|
||||
if ((update_flags & SCULPT_UPDATE_IMAGE) != 0) {
|
||||
ED_region_tag_redraw_force_single_sample(region);
|
||||
ED_region_tag_redraw(region);
|
||||
if (update_flags == SCULPT_UPDATE_IMAGE) {
|
||||
/* Early exit when only need to update the images. We don't want to tag any geometry updates
|
||||
* that would rebuilt the PBVH. */
|
||||
|
|
|
@ -742,9 +742,6 @@ enum {
|
|||
|
||||
/* Only editor overlays (currently gizmos only!) should be redrawn. */
|
||||
RGN_DRAW_EDITOR_OVERLAYS = 32,
|
||||
|
||||
/* Force single sample for some specific cases (sculpt paint tool stroke). */
|
||||
RGN_DRAW_SINGLE_SAMPLE = 64,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue
This should be hidden in
DRW_state_is_navigating
or a similar function. Not sure yet if we need to split DRW_state_is_navigating... Best to ask direction in the eevee-viewport-module on blender.chat.