LuxCore: Save/resume rendering

Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: Dade, jromang, tomb, zcott, coordinators

LuxCore: Save/resume rendering

Postby Dade » Wed Feb 08, 2017 5:01 am

Introduction

LuxCore now supports save/resume rendering for all rendering engines. A saved rendering consists, at the moment, of 2 files: a film and a rendering state. In combination with the scene and rendering configuration files, they are required to resume the rendering.

Follow the code required to save the rendering in C++:

Code: Select all
// Pause the current rendering
session->Pause();

// Save the film
session->GetFilm().SaveFilm(saveResumeName + ".flm");

// Save the render state
RenderState *renderState = session->GetRenderState();
renderState->Save(saveResumeName + ".rst");
delete renderState;

// Resume the current rendering
session->Resume();


and the code to resume:

Code: Select all
// Load the start film
Film *startFilm = new Film(saveResumeName + ".flm");

// Load the start render state
RenderState *startRenderState = new RenderState(saveResumeName + ".rst");

config = new RenderConfig(Properties(configFileName));

// Use a special RenderSession constructor to resume the rendering
session = new RenderSession(config, startState, startFilm);


The same code is used in LuxCoreUI to demo this feature.

You can find a Python example here: https://bitbucket.org/luxrender/luxrays ... emo.py-450

BiasPath

As you can easily figure out, saving the state of tile rendering is not a trivial task or a small amount of information. LuxCore has to save the status of all tiles including convergence related information like the tile films. As result saving the .rst file can require few seconds and the size can be few dozens of MB.

Next step

Once render configuration and scene serialization will be implemented (required for network rendering), it will possible to save in a single file all the information required to resume the rendering without having external dependencies like .cfg, .scn, .ply, etc.
User avatar
Dade
Developer
 
Posts: 8363
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: LuxCore: save/resume rendering

Postby Piita » Wed Feb 08, 2017 9:48 pm

Ah, fantastic! Thank you, Dade! :)
User avatar
Piita
 
Posts: 610
Joined: Sat Aug 06, 2011 2:09 pm
Location: Finland

Re: LuxCore: save/resume rendering

Postby tomb » Thu Feb 09, 2017 12:19 am

That is indeed awesome :)
User avatar
tomb
Developer
 
Posts: 2677
Joined: Thu Oct 11, 2007 4:23 pm
Location: Oslo, Norway

Re: LuxCore: save/resume rendering

Postby B.Y.O.B. » Thu Feb 09, 2017 2:23 am

Dade wrote:Once render configuration and scene serialization will be implemented (required for network rendering), it will possible to save in a single file all the information required to resume the rendering without having external dependencies like .cfg, .scn, .ply, etc.

This sounds like a good plan :)
User avatar
B.Y.O.B.
Developer
 
Posts: 5139
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

Re: LuxCore: save/resume rendering

Postby neo2068 » Fri Feb 10, 2017 12:21 am

That's great! Thank you Dade! :D
i7 5820K, 32 GB RAM, NVIDIA Geforce GTX 780 + GTX 560, Windows 10 64bit, Blender 2.77a
neo2068
Developer
 
Posts: 742
Joined: Sun May 03, 2009 2:11 am
Location: Germany


Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 2 guests