Cycles: Resumable render implementation for Cycles
This feature is also known by the name Samples Offset, which allows artists to render animation with given amount of samples N, but then render more samples, starting from N and ending with M (where M > N) and merge renders together as if they rendered exactly M samples. Surely such effect could be achieved by changing Seed variable, but that has possible issues with correlation artifacts and requiring to manually deal with per render layer samples and such. While we can't support all possible renderfarm-related features in Cycles it's nice to support really commonly used stuff. Here's a command how to run Blender with the new feature enabled: blender -- --cycles-resumable-num-chunks 24 --cycles-resumable-current-chunk 2 This command will divide samples range in 24 parts and render range #2 (chunk number is 1-based). This feature might be changed a bit after we'll do some tests here in the studio with it.
This commit is contained in:
@@ -638,6 +638,24 @@ static PyObject *debug_flags_reset_func(PyObject * /*self*/, PyObject * /*args*/
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject *set_resumable_chunks_func(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
int num_resumable_chunks, current_resumable_chunk;
|
||||
if(!PyArg_ParseTuple(args, "ii",
|
||||
&num_resumable_chunks,
|
||||
¤t_resumable_chunk)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
VLOG(1) << "Initialized resumable render: "
|
||||
<< "num_resumable_chunks=" << num_resumable_chunks << ", "
|
||||
<< "current_resumable_chunk=" << current_resumable_chunk;
|
||||
BlenderSession::num_resumable_chunks = num_resumable_chunks;
|
||||
BlenderSession::current_resumable_chunk = current_resumable_chunk;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyMethodDef methods[] = {
|
||||
{"init", init_func, METH_VARARGS, ""},
|
||||
{"exit", exit_func, METH_VARARGS, ""},
|
||||
@@ -657,8 +675,14 @@ static PyMethodDef methods[] = {
|
||||
#ifdef WITH_OPENCL
|
||||
{"opencl_disable", opencl_disable_func, METH_NOARGS, ""},
|
||||
#endif
|
||||
|
||||
/* Debugging routines */
|
||||
{"debug_flags_update", debug_flags_update_func, METH_VARARGS, ""},
|
||||
{"debug_flags_reset", debug_flags_reset_func, METH_NOARGS, ""},
|
||||
|
||||
/* Resumable render */
|
||||
{"set_resumable_chunks", set_resumable_chunks_func, METH_VARARGS, ""},
|
||||
|
||||
{NULL, NULL, 0, NULL},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user