diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-07-30 17:48:44 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-07-30 17:48:51 +0300 |
commit | 6d6deeb70086564418368a5213cd9d28cdfa51e2 (patch) | |
tree | fa715c50010d31372fa3c7ad33211d34f37e5554 /source/blender/draw | |
parent | 27567a6c760be523b77e4d95e544c60b6f9ddf84 (diff) |
Workbench: Use FXAA instead of TAA when viewport is animated.
Fix T55996 "Playback in "Active Editor Only" doesn't work"
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_effect_aa.c | 11 | ||||
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_private.h | 7 |
2 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_effect_aa.c b/source/blender/draw/engines/workbench/workbench_effect_aa.c index 66f1de7f9fc..6269496f568 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_aa.c +++ b/source/blender/draw/engines/workbench/workbench_effect_aa.c @@ -23,6 +23,8 @@ * \ingroup draw_engine */ +#include "ED_screen.h" + #include "workbench_private.h" @@ -32,6 +34,15 @@ void workbench_aa_create_pass(WORKBENCH_Data *vedata, GPUTexture **tx) WORKBENCH_PrivateData *wpd = stl->g_data; WORKBENCH_PassList *psl = vedata->psl; WORKBENCH_EffectInfo *effect_info = stl->effects; + const DRWContextState *draw_ctx = DRW_context_state_get(); + + if (draw_ctx->evil_C != NULL) { + struct wmWindowManager *wm = CTX_wm_manager(draw_ctx->evil_C); + wpd->is_playback = ED_screen_animation_playing(wm) != NULL; + } + else { + wpd->is_playback = false; + } if (TAA_ENABLED(wpd)) { psl->effect_aa_pass = workbench_taa_create_pass(vedata, tx); diff --git a/source/blender/draw/engines/workbench/workbench_private.h b/source/blender/draw/engines/workbench/workbench_private.h index 99d1b7060fd..dc2894f0207 100644 --- a/source/blender/draw/engines/workbench/workbench_private.h +++ b/source/blender/draw/engines/workbench/workbench_private.h @@ -53,8 +53,10 @@ #define SHADOW_ENABLED(wpd) (wpd->shading.flag & V3D_SHADING_SHADOW) #define IS_NAVIGATING(wpd) ((DRW_context_state_get()->rv3d) && (DRW_context_state_get()->rv3d->rflag & RV3D_NAVIGATING)) -#define FXAA_ENABLED(wpd) ((!DRW_state_is_opengl_render()) && (IN_RANGE(wpd->user_preferences->gpu_viewport_quality, GPU_VIEWPORT_QUALITY_FXAA, GPU_VIEWPORT_QUALITY_TAA8) || ((wpd->user_preferences->gpu_viewport_quality >= GPU_VIEWPORT_QUALITY_TAA8) && IS_NAVIGATING(wpd)))) -#define TAA_ENABLED(wpd) (wpd->user_preferences->gpu_viewport_quality >= GPU_VIEWPORT_QUALITY_TAA8 && !IS_NAVIGATING(wpd)) +#define FXAA_ENABLED(wpd) ((!DRW_state_is_opengl_render()) && \ + (IN_RANGE(wpd->user_preferences->gpu_viewport_quality, GPU_VIEWPORT_QUALITY_FXAA, GPU_VIEWPORT_QUALITY_TAA8) || \ + ((IS_NAVIGATING(wpd) || wpd->is_playback) && (wpd->user_preferences->gpu_viewport_quality >= GPU_VIEWPORT_QUALITY_TAA8)))) +#define TAA_ENABLED(wpd) (wpd->user_preferences->gpu_viewport_quality >= GPU_VIEWPORT_QUALITY_TAA8 && !IS_NAVIGATING(wpd) && !wpd->is_playback) #define SPECULAR_HIGHLIGHT_ENABLED(wpd) ((wpd->shading.flag & V3D_SHADING_SPECULAR_HIGHLIGHT) && (!STUDIOLIGHT_ORIENTATION_VIEWNORMAL_ENABLED(wpd))) #define OBJECT_ID_PASS_ENABLED(wpd) (wpd->shading.flag & V3D_SHADING_OBJECT_OUTLINE) #define NORMAL_VIEWPORT_COMP_PASS_ENABLED(wpd) (MATCAP_ENABLED(wpd) || STUDIOLIGHT_ENABLED(wpd) || SHADOW_ENABLED(wpd) || SPECULAR_HIGHLIGHT_ENABLED(wpd)) @@ -174,6 +176,7 @@ typedef struct WORKBENCH_PrivateData { float shadow_near_max[3]; float shadow_near_sides[2][4]; /* This is a parallelogram, so only 2 normal and distance to the edges. */ bool shadow_changed; + bool is_playback; /* Volumes */ bool volumes_do; |