diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-02-20 18:55:02 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-02-28 00:25:54 +0300 |
commit | 06420c5fe8fda54c543f26f9d95d2c6fcf5161cd (patch) | |
tree | 2cb566ad03dd15a34f3d04d0826c33aa096efada /source/blender/makesrna/intern/rna_render.c | |
parent | bd119ab0177a380a1736677278c02790d8235be4 (diff) |
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
Diffstat (limited to 'source/blender/makesrna/intern/rna_render.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 15487082217..99567872103 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -147,7 +147,7 @@ static void engine_unbind_display_space_shader(RenderEngine *UNUSED(engine)) IMB_colormanagement_finish_glsl_draw(); } -static void engine_update(RenderEngine *engine, Main *bmain, Depsgraph *graph, Scene *scene) +static void engine_update(RenderEngine *engine, Main *bmain, Scene *scene) { extern FunctionRNA rna_RenderEngine_update_func; PointerRNA ptr; @@ -159,14 +159,13 @@ static void engine_update(RenderEngine *engine, Main *bmain, Depsgraph *graph, S RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "data", &bmain); - RNA_parameter_set_lookup(&list, "depsgraph", &graph); RNA_parameter_set_lookup(&list, "scene", &scene); engine->type->ext.call(NULL, &ptr, func, &list); RNA_parameter_list_free(&list); } -static void engine_render_to_image(RenderEngine *engine, struct Depsgraph *depsgraph) +static void engine_render_to_image(RenderEngine *engine, Depsgraph *depsgraph) { extern FunctionRNA rna_RenderEngine_render_to_image_func; PointerRNA ptr; @@ -398,16 +397,6 @@ static PointerRNA rna_RenderEngine_render_get(PointerRNA *ptr) } } -static PointerRNA rna_RenderEngine_view_layer_get(PointerRNA *ptr) -{ - RenderEngine *engine = (RenderEngine *)ptr->data; - if (engine->re != NULL) { - ViewLayer *view_layer = RE_engine_get_view_layer(engine->re); - return rna_pointer_inherit_refine(ptr, &RNA_ViewLayer, view_layer); - } - return rna_pointer_inherit_refine(ptr, &RNA_ViewLayer, NULL); -} - static PointerRNA rna_RenderEngine_camera_override_get(PointerRNA *ptr) { RenderEngine *engine = (RenderEngine *)ptr->data; @@ -518,7 +507,7 @@ static void rna_def_render_engine(BlenderRNA *brna) func = RNA_def_function(srna, "render_to_image", NULL); RNA_def_function_ui_description(func, "Render scene into an image"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); - RNA_def_pointer(func, "desgraph", "Depsgraph", "", ""); + RNA_def_pointer(func, "depsgraph", "Depsgraph", "", ""); func = RNA_def_function(srna, "bake", NULL); RNA_def_function_ui_description(func, "Bake passes"); @@ -769,11 +758,6 @@ static void rna_def_render_engine(BlenderRNA *brna) prop = RNA_def_enum(func, "type", render_pass_type_items, SOCK_FLOAT, "Type", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - prop = RNA_def_property(srna, "view_layer", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "ViewLayer"); - RNA_def_property_pointer_funcs(prop, "rna_RenderEngine_view_layer_get", NULL, NULL, NULL); - RNA_def_property_ui_text(prop, "Scene layer", ""); - /* registration */ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); |