Cycles: merge of changes from tomato branch.

Regular rendering now works tiled, and supports save buffers to save memory
during render and cache render results.

Brick texture node by Thomas.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Brick_Texture

Image texture Blended Box Mapping.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Image_Texture
http://mango.blender.org/production/blended_box/

Various bug fixes by Sergey and Campbell.
* Fix for reading freed memory in some node setups.
* Fix incorrect memory read when synchronizing mesh motion.
* Fix crash appearing when direct light usage is different on different layers.
* Fix for vector pass gives wrong result in some circumstances.
* Fix for wrong resolution used for rendering Render Layer node.
* Option to cancel rendering when doing initial synchronization.
* No more texture limit when using CPU render.
* Many fixes for new tiled rendering.
This commit is contained in:
2012-09-04 13:29:07 +00:00
parent 68563134d4
commit adea12cb01
69 changed files with 1983 additions and 708 deletions

View File

@@ -640,7 +640,7 @@ static void *do_part_thread(void *pa_v)
if (!R.sss_points && (R.r.scemode & R_FULL_SAMPLE))
pa->result = render_result_new_full_sample(&R, &pa->fullresult, &pa->disprect, pa->crop, RR_USE_MEM);
else
pa->result = render_result_new(&R, &pa->disprect, pa->crop, RR_USE_MEM);
pa->result = render_result_new(&R, &pa->disprect, pa->crop, RR_USE_MEM, RR_ALL_LAYERS);
if (R.sss_points)
zbufshade_sss_tile(pa);
@@ -650,7 +650,7 @@ static void *do_part_thread(void *pa_v)
zbufshade_tile(pa);
/* merge too on break! */
if (R.result->exrhandle) {
if (R.result->do_exr_tile) {
render_result_exr_file_merge(R.result, pa->result);
}
else if (render_display_draw_enabled(&R)) {
@@ -794,12 +794,12 @@ static void threaded_tile_processor(Render *re)
render_result_free(re->result);
if (re->sss_points && render_display_draw_enabled(re))
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM);
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS);
else if (re->r.scemode & R_FULL_SAMPLE)
re->result = render_result_new_full_sample(re, &re->fullresult, &re->disprect, 0, RR_USE_EXR);
else
re->result = render_result_new(re, &re->disprect, 0,
(re->r.scemode & R_EXR_TILE_FILE) ? RR_USE_EXR : RR_USE_MEM);
(re->r.scemode & R_EXR_TILE_FILE) ? RR_USE_EXR : RR_USE_MEM, RR_ALL_LAYERS);
}
BLI_rw_mutex_unlock(&re->resultmutex);
@@ -809,9 +809,9 @@ static void threaded_tile_processor(Render *re)
/* warning; no return here without closing exr file */
initparts(re);
initparts(re, TRUE);
if (re->result->exrhandle)
if (re->result->do_exr_tile)
render_result_exr_file_begin(re);
BLI_init_threads(&threads, do_part_thread, re->r.threads);
@@ -891,7 +891,7 @@ static void threaded_tile_processor(Render *re)
}
if (re->result->exrhandle) {
if (re->result->do_exr_tile) {
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
render_result_exr_file_end(re);
BLI_rw_mutex_unlock(&re->resultmutex);
@@ -1044,7 +1044,7 @@ static void do_render_blur_3d(Render *re)
int blur = re->r.mblur_samples;
/* create accumulation render result */
rres = render_result_new(re, &re->disprect, 0, RR_USE_MEM);
rres = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS);
/* do the blur steps */
while (blur--) {
@@ -1169,7 +1169,7 @@ static void do_render_fields_3d(Render *re)
re->disprect.ymax *= 2;
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM);
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS);
if (rr2) {
if (re->r.mode & R_ODDFIELD)
@@ -1232,7 +1232,7 @@ static void do_render_fields_blur_3d(Render *re)
re->rectx = re->winx;
re->recty = re->winy;
rres = render_result_new(re, &re->disprect, 0, RR_USE_MEM);
rres = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS);
render_result_merge(rres, re->result);
render_result_free(re->result);
@@ -1552,7 +1552,7 @@ static void do_render_composite_fields_blur_3d(Render *re)
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
render_result_free(re->result);
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM);
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS);
BLI_rw_mutex_unlock(&re->resultmutex);
@@ -1847,7 +1847,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
if (scene->r.scemode & (R_EXR_TILE_FILE | R_FULL_SAMPLE)) {
char str[FILE_MAX];
render_result_exr_file_path(scene, 0, str);
render_result_exr_file_path(scene, "", 0, str);
if (BLI_file_is_writable(str) == 0) {
BKE_report(reports, RPT_ERROR, "Can not save render buffers, check the temp default path");
@@ -1931,7 +1931,7 @@ static void validate_render_settings(Render *re)
if (RE_engine_is_external(re)) {
/* not supported yet */
re->r.scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
re->r.scemode &= ~(R_FULL_SAMPLE);
re->r.mode &= ~(R_FIELDS | R_MBLUR);
}
}
@@ -2421,7 +2421,7 @@ void RE_layer_load_from_file(RenderLayer *layer, ReportList *reports, const char
void RE_result_load_from_file(RenderResult *result, ReportList *reports, const char *filename)
{
if (!render_result_exr_file_read_path(result, filename)) {
if (!render_result_exr_file_read_path(result, NULL, filename)) {
BKE_reportf(reports, RPT_ERROR, "RE_result_rect_from_file: failed to load '%s'\n", filename);
return;
}