From 06420c5fe8fda54c543f26f9d95d2c6fcf5161cd Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Tue, 20 Feb 2018 12:55:02 -0300 Subject: Refactor depsgraph/render logic to serve evaluated depsgraph to engines User notes ---------- Compositing, rendering of multi-layers in Eevee should be fully working now. Development notes ----------------- Up until now we were still using the same depsgraph for rendering and viewport evaluation. And we had to go out of our ways to be sure the depsgraphs were updated. Now we iterate over the (to be rendered) view layers and create a depsgraph to each one, fully evaluated and call the render engines (Cycles, Eevee, ...) with this viewlayer/depsgraph/evaluation context. At this time we are not handling data persistency, Depsgraph is created from scratch prior to rendering each frame. So I got rid of most of the partial update calls we had during the render pipeline. Cycles: Brecht Van Lommel did a patch to tackle some of the required Cycles changes but this commit mark these changes as TODOs. Basically Cycles needs to render one layer at a time. Reviewers: sergey, brecht Differential Revision: https://developer.blender.org/D3073 --- source/creator/creator_args.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'source/creator') diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 8517d870b8b..2dd21c3886f 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -428,26 +428,6 @@ static void arg_py_context_restore( /** \} */ -static void render_set_depgraph(bContext *C, Render *re) -{ - /* TODO(sergey): For until we make depsgraph to be created and - * handled by render pipeline. - */ - Main *bmain = CTX_data_main(C); - Scene *scene = CTX_data_scene(C); - /* NOTE: This is STUPID to use first layer, but is ok for now - * (at least for until depsgraph becomes per-layer). - * Apparently, CTX_data_layer is crashing here (context's layer - * is NULL for old files, and there is no workspace). - */ - ViewLayer *view_layer = scene->view_layers.first; - Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true); - DEG_graph_relations_update(depsgraph, bmain, scene, view_layer); - DEG_graph_on_visible_update(bmain, depsgraph); - - RE_SetDepsgraph(re, depsgraph); -} - /* -------------------------------------------------------------------- */ /** \name Handle Argument Callbacks @@ -1385,7 +1365,6 @@ static int arg_handle_render_frame(int argc, const char **argv, void *data) BLI_threaded_malloc_begin(); BKE_reports_init(&reports, RPT_STORE); RE_SetReports(re, &reports); - render_set_depgraph(C, re); for (int i = 0; i < frames_range_len; i++) { /* We could pass in frame ranges, * but prefer having exact behavior as passing in multiple frames */ @@ -1428,7 +1407,6 @@ static int arg_handle_render_animation(int UNUSED(argc), const char **UNUSED(arg BLI_threaded_malloc_begin(); BKE_reports_init(&reports, RPT_STORE); RE_SetReports(re, &reports); - render_set_depgraph(C, re); RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step); RE_SetReports(re, NULL); BKE_reports_clear(&reports); -- cgit v1.2.3