Cycles: add offscreen dicing scale and dicing camera.

The offscreen dicing scale helps to significantly reduce memory usage,
by reducing the dicing rate for objects the further they are outside of
the camera view.

The dicing camera can be specified now, to keep the geometry fixed and
avoid crawling artifacts in animation. It is also useful for debugging,
to see the tesselation from a different camera location.

Differential Revision: https://developer.blender.org/D2891
This commit is contained in:
Mai Lavelle
2018-01-12 00:50:34 +01:00
committed by Brecht Van Lommel
parent 2dbcc17897
commit cce280dd67
8 changed files with 179 additions and 25 deletions

View File

@@ -85,6 +85,7 @@ Scene::Scene(const SceneParams& params_, Device *device)
memset(&dscene.data, 0, sizeof(dscene.data));
camera = new Camera();
dicing_camera = new Camera();
lookup_tables = new LookupTables();
film = new Film();
background = new Background();
@@ -155,6 +156,7 @@ void Scene::free_memory(bool final)
if(final) {
delete lookup_tables;
delete camera;
delete dicing_camera;
delete film;
delete background;
delete integrator;
@@ -359,6 +361,7 @@ void Scene::reset()
/* ensure all objects are updated */
camera->tag_update();
dicing_camera->tag_update();
film->tag_update(this);
background->tag_update(this);
integrator->tag_update(this);