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:
authorJeroen Bakker <j.bakker@atmind.nl>2019-05-08 16:38:11 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-05-09 15:45:45 +0300
commit0764cfe3deea2d39376a660ff06e8dc17f6401ba (patch)
treef12eab97bb5a227c9f2ace59edaad37f90e3062a /source/blender/blenloader
parent54ec0559c8ef203f2c029fc0e43373538ae5515f (diff)
Workbench: Viewport AA Preferences
In recent changes the viewport_quality setting was not working what users expected. This change will separate the anti-aliasing method that is being used. We now have three settings: * scene.display.render_aa: Will be used during `Render Image`. * scene.display.viewport_aa: Will be used during `Viewport Render Image`. * userpref.viewport_aa: Will be used in the 3d view. The viewport_quality setting has been replaced by the viewport_aa setting as it was the only thing in currently controlled. Reviewed By: brecht Maniphest Tasks: T64132 Differential Revision: https://developer.blender.org/D4828
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 1fa1d0b2683..b3e437e39de 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -19,7 +19,7 @@
*
* Version patch user preferences.
*/
-
+#define DNA_DEPRECATED_ALLOW
#include <string.h>
#include "BLI_math.h"
@@ -28,6 +28,7 @@
#include "DNA_userdef_types.h"
#include "DNA_curve_types.h"
#include "DNA_windowmanager_types.h"
+#include "DNA_scene_types.h"
#include "BKE_addon.h"
#include "BKE_colorband.h"
@@ -554,6 +555,29 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
userdef->dupflag |= USER_DUP_GPENCIL;
}
+ if (!USER_VERSION_ATLEAST(280, 60)) {
+ const float GPU_VIEWPORT_QUALITY_FXAA = 0.10f;
+ const float GPU_VIEWPORT_QUALITY_TAA8 = 0.25f;
+ const float GPU_VIEWPORT_QUALITY_TAA16 = 0.6f;
+ const float GPU_VIEWPORT_QUALITY_TAA32 = 0.8f;
+
+ if (userdef->gpu_viewport_quality < GPU_VIEWPORT_QUALITY_FXAA) {
+ userdef->viewport_aa = SCE_DISPLAY_AA_OFF;
+ }
+ else if (userdef->gpu_viewport_quality < GPU_VIEWPORT_QUALITY_TAA8) {
+ userdef->viewport_aa = SCE_DISPLAY_AA_FXAA;
+ }
+ else if (userdef->gpu_viewport_quality < GPU_VIEWPORT_QUALITY_TAA16) {
+ userdef->viewport_aa = SCE_DISPLAY_AA_SAMPLES_8;
+ }
+ else if (userdef->gpu_viewport_quality < GPU_VIEWPORT_QUALITY_TAA32) {
+ userdef->viewport_aa = SCE_DISPLAY_AA_SAMPLES_16;
+ }
+ else {
+ userdef->viewport_aa = SCE_DISPLAY_AA_SAMPLES_32;
+ }
+ }
+
/**
* Include next version bump.
*/