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/blenkernel/intern/dynamicpaint.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/blenkernel/intern/dynamicpaint.c')
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 349f995819c..22a1f9b4b18 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -3348,7 +3348,7 @@ typedef struct BrushMaterials { /* Initialize materials for brush object: * Calculates inverse matrices for linked objects, updates * volume caches etc. */ -static void dynamicPaint_updateBrushMaterials(Object *brushOb, Material *ui_mat, Scene *scene, BrushMaterials *bMats) +static void dynamicPaint_updateBrushMaterials(const EvaluationContext *eval_ctx, Object *brushOb, Material *ui_mat, Scene *scene, BrushMaterials *bMats) { /* Calculate inverse transformation matrix * for this object */ @@ -3363,13 +3363,13 @@ static void dynamicPaint_updateBrushMaterials(Object *brushOb, Material *ui_mat, if (tot) { bMats->ob_mats = MEM_callocN(sizeof(Material *) * (tot), "BrushMaterials"); for (i = 0; i < tot; i++) { - bMats->ob_mats[i] = RE_sample_material_init(give_current_material(brushOb, (i + 1)), scene); + bMats->ob_mats[i] = RE_sample_material_init(eval_ctx, give_current_material(brushOb, (i + 1)), scene); } } bMats->tot = tot; } else { - bMats->mat = RE_sample_material_init(ui_mat, scene); + bMats->mat = RE_sample_material_init(eval_ctx, ui_mat, scene); } } @@ -6087,7 +6087,7 @@ static int dynamicPaint_doStep(const struct EvaluationContext *eval_ctx, Scene * } /* Prepare materials if required */ if (brush_usesMaterial(brush, scene)) - dynamicPaint_updateBrushMaterials(brushObj, brush->mat, scene, &bMats); + dynamicPaint_updateBrushMaterials(eval_ctx, brushObj, brush->mat, scene, &bMats); /* Apply brush on the surface depending on it's collision type */ if (brush->psys && brush->psys->part && |