Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2021-05-18 02:03:01 +0300
committerPablo Dobarro <pablodp606@gmail.com>2021-06-03 21:17:17 +0300
commitdba3fb9e091acfa7d2144468a220b2b0d577c15d (patch)
tree817e5c84a1f7319b7ef7811226dabcae615b63ea /source/blender/draw/engines/overlay/overlay_private.h
parent3e695a27cdfad560d0b28e742cfa069d098200d6 (diff)
Overlay: Flash on Mode Transfer overlay
This implements T87633 This overlay renders a flash animation on the target object when transfering the mode to it using the mode transfer operator. This provides visual feedback when switching between objects without extra overlays that affect the general color and lighting in the scene. Differences with the design task: - This uses just a fade out animation instead of a fade in/out animation. The code is ready for fade in/out, but as the rest of the overlays (face sets, masks...) change instantly without animation, having a fade in/out effect gives the impression that the object flashes twice (once for the face sets, twice for the peak alpha of the flash animation). - The rendering uses a flat color without fresnel for now, but this can be improved in the future to make it look more like the shader in the prototype. - Not enabled by default (can be enabled in the overlays panel), maybe the defaults can change for 3.0 to disable fade inactive and enable this instead. Reviewed By: jbakker, JulienKaspar Differential Revision: https://developer.blender.org/D11055
Diffstat (limited to 'source/blender/draw/engines/overlay/overlay_private.h')
-rw-r--r--source/blender/draw/engines/overlay/overlay_private.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_private.h b/source/blender/draw/engines/overlay/overlay_private.h
index db43136e308..969289a3219 100644
--- a/source/blender/draw/engines/overlay/overlay_private.h
+++ b/source/blender/draw/engines/overlay/overlay_private.h
@@ -107,6 +107,7 @@ typedef struct OVERLAY_PassList {
DRWPass *gpencil_canvas_ps;
DRWPass *facing_ps[2];
DRWPass *fade_ps[2];
+ DRWPass *mode_transfer_ps[2];
DRWPass *grid_ps;
DRWPass *image_background_ps;
DRWPass *image_background_scene_ps;
@@ -282,6 +283,7 @@ typedef struct OVERLAY_PrivateData {
DRWShadingGroup *extra_grid_grp;
DRWShadingGroup *facing_grp[2];
DRWShadingGroup *fade_grp[2];
+ DRWShadingGroup *flash_grp[2];
DRWShadingGroup *motion_path_lines_grp;
DRWShadingGroup *motion_path_points_grp;
DRWShadingGroup *outlines_grp;
@@ -414,6 +416,10 @@ typedef struct OVERLAY_PrivateData {
struct {
DRWCallBuffer *handle[2];
} mball;
+ struct {
+ double time;
+ bool any_animated;
+ } mode_transfer;
} OVERLAY_PrivateData; /* Transient data */
typedef struct OVERLAY_StorageList {
@@ -607,6 +613,12 @@ void OVERLAY_fade_cache_populate(OVERLAY_Data *vedata, Object *ob);
void OVERLAY_fade_draw(OVERLAY_Data *vedata);
void OVERLAY_fade_infront_draw(OVERLAY_Data *vedata);
+void OVERLAY_mode_transfer_cache_init(OVERLAY_Data *vedata);
+void OVERLAY_mode_transfer_cache_populate(OVERLAY_Data *vedata, Object *ob);
+void OVERLAY_mode_transfer_draw(OVERLAY_Data *vedata);
+void OVERLAY_mode_transfer_infront_draw(OVERLAY_Data *vedata);
+void OVERLAY_mode_transfer_cache_finish(OVERLAY_Data *vedata);
+
void OVERLAY_grid_init(OVERLAY_Data *vedata);
void OVERLAY_grid_cache_init(OVERLAY_Data *vedata);
void OVERLAY_grid_draw(OVERLAY_Data *vedata);