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-02 16:18:53 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-05-02 17:19:12 +0300
commitb52a0c78aff3afd49c0712ee35ba01f6b48662f7 (patch)
tree3dadc3f008de4c77962299777357a6075732ce41 /source/blender/editors/render
parent76193106d2e3d1d211af33f39a3714e22944cb18 (diff)
Workbench,EEVEE: Viewport Render Samples
- Add `render_aa` and `viewport_aa` sampling setting for workbench. 0 samples means no AA, 1 sample uses FXAA and more samples will use TAA. The viewport `gpu_viewport_quality` can still limit viewport anti-aliasing method. - Use TAA when rendering images. (this used to be CPU based FSAA) - Removed `R_OSA` related settings. Reviewers: fclem, brecht Maniphest Tasks: T60847 Differential Revision: https://developer.blender.org/D4773
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r--source/blender/editors/render/render_opengl.c26
-rw-r--r--source/blender/editors/render/render_preview.c8
2 files changed, 5 insertions, 29 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 28cfce00e6e..342c6269419 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -489,8 +489,6 @@ static void screen_opengl_render_apply(const bContext *C, OGLRender *oglrender)
for (view_id = 0; view_id < oglrender->views_len; view_id++) {
context.view_id = view_id;
context.gpu_offscreen = oglrender->ofs;
- context.gpu_full_samples = oglrender->ofs_full_samples;
-
oglrender->seq_data.ibufs_arr[view_id] = BKE_sequencer_give_ibuf(&context, CFRA, chanshown);
}
}
@@ -517,24 +515,6 @@ static void screen_opengl_render_apply(const bContext *C, OGLRender *oglrender)
}
}
-static bool screen_opengl_fullsample_enabled(Scene *scene)
-{
- if (scene->r.scemode & R_FULL_SAMPLE) {
- return true;
- }
- else {
- /* XXX TODO:
- * Technically if the hardware supports MSAA we could keep using Blender 2.7x approach.
- * However anti-aliasing without full_sample is not playing well even in 2.7x.
- *
- * For example, if you enable depth of field, there is aliasing, even if the viewport is fine.
- * For 2.8x this is more complicated because so many things rely on shader.
- * So until we fix the gpu_framebuffer anti-aliasing suupport we need to force full sample.
- */
- return true;
- }
-}
-
static bool screen_opengl_render_init(bContext *C, wmOperator *op)
{
/* new render clears all callbacks */
@@ -548,8 +528,6 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op)
GPUOffScreen *ofs;
OGLRender *oglrender;
int sizex, sizey;
- const int samples = (scene->r.mode & R_OSA) ? scene->r.osa : 0;
- const bool full_samples = (samples != 0) && screen_opengl_fullsample_enabled(scene);
bool is_view_context = RNA_boolean_get(op->ptr, "view_context");
const bool is_animation = RNA_boolean_get(op->ptr, "animation");
const bool is_sequencer = RNA_boolean_get(op->ptr, "sequencer");
@@ -598,7 +576,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op)
/* corrects render size with actual size, not every card supports non-power-of-two dimensions */
DRW_opengl_context_enable(); /* Offscreen creation needs to be done in DRW context. */
- ofs = GPU_offscreen_create(sizex, sizey, full_samples ? 0 : samples, true, true, err_out);
+ ofs = GPU_offscreen_create(sizex, sizey, 0, true, true, err_out);
DRW_opengl_context_disable();
if (!ofs) {
@@ -611,8 +589,6 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op)
op->customdata = oglrender;
oglrender->ofs = ofs;
- oglrender->ofs_samples = samples;
- oglrender->ofs_full_samples = full_samples;
oglrender->sizex = sizex;
oglrender->sizey = sizey;
oglrender->bmain = CTX_data_main(C);
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index bf6d658f927..64f20a4a348 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -449,7 +449,7 @@ static Scene *preview_prepare_scene(
}
}
else {
- sce->r.mode &= ~(R_OSA);
+ sce->display.render_aa = SCE_DISPLAY_AA_OFF;
}
for (Base *base = view_layer->object_bases.first; base; base = base->next) {
@@ -861,7 +861,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
if (sp->pr_method == PR_ICON_RENDER) {
sce->r.scemode |= R_NO_IMAGE_LOAD;
- sce->r.mode |= R_OSA;
+ sce->display.render_aa = SCE_DISPLAY_AA_SAMPLES_8;
}
else if (sp->pr_method == PR_NODE_RENDER) {
if (idtype == ID_MA) {
@@ -870,10 +870,10 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
else if (idtype == ID_TE) {
sce->r.scemode |= R_TEXNODE_PREVIEW;
}
- sce->r.mode &= ~R_OSA;
+ sce->display.render_aa = SCE_DISPLAY_AA_OFF;
}
else { /* PR_BUTS_RENDER */
- sce->r.mode |= R_OSA;
+ sce->display.render_aa = SCE_DISPLAY_AA_SAMPLES_8;
}
/* callbacs are cleared on GetRender() */