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>2018-06-27 13:55:49 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-06-27 13:59:01 +0300
commit20b8e1d8f1ebc4091f59e9bca32264717849a39b (patch)
tree09cabce715e9cdd0b09308a826e6b1d3d32f203a /source/blender/draw/engines/workbench/workbench_deferred.c
parentcf2dcd57c0a6211de22abbf2c40a6eed80d77416 (diff)
Workbench: Added a quality slider for the viewport
Currently only attached to the Anti Aliasing of the solid mode of the viewport. But eventually we could add other options here. Quality setting can be found in the System tab of the userpref. The slider goes from No Antialiasing (0.0 - 0.1) to FXAA (0.1 - 0.25) to TAA8 (0.25 - 0.6) to TAA16 (0.6 - 0.8) to TAA32 (0.8 - 1.0)
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_deferred.c')
-rw-r--r--source/blender/draw/engines/workbench/workbench_deferred.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c
index 96ed345ed45..17470dada39 100644
--- a/source/blender/draw/engines/workbench/workbench_deferred.c
+++ b/source/blender/draw/engines/workbench/workbench_deferred.c
@@ -268,7 +268,6 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata)
{
WORKBENCH_FramebufferList *fbl = vedata->fbl;
WORKBENCH_StorageList *stl = vedata->stl;
- WORKBENCH_TextureList *txl = vedata->txl;
WORKBENCH_PassList *psl = vedata->psl;
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
@@ -382,7 +381,8 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata)
const DRWContextState *draw_ctx = DRW_context_state_get();
Scene *scene = draw_ctx->scene;
/* AO Samples Tex */
- const int ssao_samples = scene->display.matcap_ssao_samples;
+ const int ssao_samples_single_iteration = scene->display.matcap_ssao_samples;
+ const int ssao_samples = MIN2(ssao_samples_single_iteration, 500);
if (e_data.sampling_ubo && (e_data.cached_sample_num != ssao_samples)) {
DRW_UBO_FREE_SAFE(e_data.sampling_ubo);
DRW_TEXTURE_FREE_SAFE(e_data.jitter_tx);
@@ -405,6 +405,19 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata)
}
{
+ if (TAA_ENABLED(wpd)) {
+ psl->effect_aa_pass = workbench_taa_create_pass(vedata, &e_data.composite_buffer_tx);
+ }
+ else if (FXAA_ENABLED(wpd)) {
+ psl->effect_aa_pass = workbench_fxaa_create_pass(&e_data.effect_buffer_tx);
+ stl->effects->jitter_index = 0;
+ }
+ else {
+ psl->effect_aa_pass = NULL;
+ }
+ }
+
+ {
int state = DRW_STATE_WRITE_COLOR;
psl->cavity_pass = DRW_pass_create("Cavity", state);
DRWShadingGroup *grp = DRW_shgroup_create(e_data.cavity_sh, psl->cavity_pass);
@@ -421,19 +434,6 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata)
DRW_shgroup_uniform_block(grp, "samples_block", e_data.sampling_ubo);
DRW_shgroup_call_add(grp, DRW_cache_fullscreen_quad_get(), NULL);
}
-
- {
- if (TAA_ENABLED(wpd)) {
- psl->effect_aa_pass = workbench_taa_create_pass(txl, stl->effects, fbl, &e_data.composite_buffer_tx);
- }
- else if (FXAA_ENABLED(wpd)) {
- psl->effect_aa_pass = workbench_fxaa_create_pass(&e_data.effect_buffer_tx);
- stl->effects->jitter_index = 0;
- }
- else {
- psl->effect_aa_pass = NULL;
- }
- }
}
void workbench_deferred_engine_free(void)
@@ -845,7 +845,7 @@ void workbench_deferred_draw_scene(WORKBENCH_Data *vedata)
if (taa_enabled)
{
- workbench_taa_draw_scene_start(effect_info);
+ workbench_taa_draw_scene_start(vedata);
}
/* clear in background */