Fix/Workaround T44662: Freestyle gives no visual output when the Save Buffers option is enabled
For now we solve this for non-multiview renders by merging exr file back into full render result prior to rendering freestyle strokes. Multiview case is still to be supported tho.
This commit is contained in:
@@ -121,6 +121,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* Freestyle needs the whole frame to be merged into memory prior to
|
||||
* doing stroke rendering. This conflicts a bit with multiview save
|
||||
* buffers behavior which does a merge of exr files after all the
|
||||
* views are rendered.
|
||||
*
|
||||
* For until a proper solution is implemented we'll just merge single
|
||||
* view image prior to freestyle stroke rendering, which is how this
|
||||
* worked prior to multiview. Multiview+freestyle+save buffers are
|
||||
* considered unsupported for the time being.
|
||||
*/
|
||||
#define FREESTYLR_SAVEBUFFERS_WORKAROUND
|
||||
|
||||
/* ********* globals ******** */
|
||||
|
||||
@@ -1426,6 +1437,9 @@ void RE_TileProcessor(Render *re)
|
||||
|
||||
static void do_render_3d(Render *re)
|
||||
{
|
||||
#ifdef FREESTYLR_SAVEBUFFERS_WORKAROUND
|
||||
const bool do_early_result_merge = (re->r.scemode & R_MULTIVIEW) == 0;
|
||||
#endif
|
||||
RenderView *rv;
|
||||
int cfra_backup;
|
||||
|
||||
@@ -1473,7 +1487,13 @@ static void do_render_3d(Render *re)
|
||||
re->draw_lock(re->dlh, 0);
|
||||
|
||||
threaded_tile_processor(re);
|
||||
|
||||
|
||||
#ifdef FREESTYLR_SAVEBUFFERS_WORKAROUND
|
||||
if (do_early_result_merge) {
|
||||
main_render_result_end(re);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FREESTYLE
|
||||
/* Freestyle */
|
||||
if (re->r.mode & R_EDGE_FRS)
|
||||
@@ -1490,7 +1510,13 @@ static void do_render_3d(Render *re)
|
||||
RE_Database_Free(re);
|
||||
}
|
||||
|
||||
#ifdef FREESTYLR_SAVEBUFFERS_WORKAROUND
|
||||
if (!do_early_result_merge) {
|
||||
main_render_result_end(re);
|
||||
}
|
||||
#else
|
||||
main_render_result_end(re);
|
||||
#endif
|
||||
|
||||
re->scene->r.cfra = cfra_backup;
|
||||
re->scene->r.subframe = 0.f;
|
||||
@@ -2929,6 +2955,13 @@ bool RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *
|
||||
BKE_report(reports, RPT_ERROR, "Fields not supported in Freestyle");
|
||||
return false;
|
||||
}
|
||||
|
||||
# ifdef FREESTYLR_SAVEBUFFERS_WORKAROUND
|
||||
if ((scene->r.scemode & R_MULTIVIEW) != 0 && (scene->r.scemode & R_EXR_TILE_FILE) != 0) {
|
||||
BKE_report(reports, RPT_ERROR, "Multiview combined with Save Buffers not supported in Freestyle");
|
||||
return false;
|
||||
}
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user