Fix #35986: "Full sample AA not supported without 3d rendering" message was

displayed even with antialiasing disabled.
This commit is contained in:
Brecht Van Lommel
2013-07-03 17:02:09 +00:00
parent bce00b605c
commit 721237cf29

View File

@@ -468,6 +468,30 @@ void RE_FreePersistentData(void)
/* ********* initialize state ******** */
/* clear full sample and tile flags if needed */
static int check_mode_full_sample(RenderData *rd)
{
int scemode = rd->scemode;
if ((rd->mode & R_OSA) == 0)
scemode &= ~R_FULL_SAMPLE;
#ifdef WITH_OPENEXR
if (scemode & R_FULL_SAMPLE)
scemode |= R_EXR_TILE_FILE; /* enable automatic */
/* Until use_border is made compatible with save_buffers/full_sample, render without the later instead of not rendering at all.*/
if (rd->mode & R_BORDER) {
scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
}
#else
/* can't do this without openexr support */
scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
#endif
return scemode;
}
/* what doesn't change during entire render sequence */
/* disprect is optional, if NULL it assumes full window render */
@@ -533,22 +557,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *
return;
}
if ((re->r.mode & (R_OSA)) == 0)
re->r.scemode &= ~R_FULL_SAMPLE;
#ifdef WITH_OPENEXR
if (re->r.scemode & R_FULL_SAMPLE)
re->r.scemode |= R_EXR_TILE_FILE; /* enable automatic */
/* Until use_border is made compatible with save_buffers/full_sample, render without the later instead of not rendering at all.*/
if (re->r.mode & R_BORDER) {
re->r.scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
}
#else
/* can't do this without openexr support */
re->r.scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
#endif
re->r.scemode = check_mode_full_sample(&re->r);
/* fullsample wants uniform osa levels */
if (source && (re->r.scemode & R_FULL_SAMPLE)) {
@@ -2222,6 +2231,7 @@ static int check_composite_output(Scene *scene)
int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *reports)
{
SceneRenderLayer *srl;
int scemode = check_mode_full_sample(&scene->r);
if (scene->r.mode & R_BORDER) {
if (scene->r.border.xmax <= scene->r.border.xmin ||
@@ -2232,7 +2242,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
}
}
if (scene->r.scemode & (R_EXR_TILE_FILE | R_FULL_SAMPLE)) {
if (scemode & (R_EXR_TILE_FILE | R_FULL_SAMPLE)) {
char str[FILE_MAX];
render_result_exr_file_path(scene, "", 0, str);
@@ -2243,16 +2253,14 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
}
/* no fullsample and edge */
if ((scene->r.scemode & R_FULL_SAMPLE) && (scene->r.mode & R_EDGE)) {
if ((scemode & R_FULL_SAMPLE) && (scene->r.mode & R_EDGE)) {
BKE_report(reports, RPT_ERROR, "Full sample does not support edge enhance");
return 0;
}
}
else
scene->r.scemode &= ~R_FULL_SAMPLE; /* clear to be sure */
if (scene->r.scemode & R_DOCOMP) {
if (scemode & R_DOCOMP) {
if (scene->use_nodes) {
if (!scene->nodetree) {
BKE_report(reports, RPT_ERROR, "No node tree in scene");
@@ -2264,7 +2272,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
return 0;
}
if (scene->r.scemode & R_FULL_SAMPLE) {
if (scemode & R_FULL_SAMPLE) {
if (composite_needs_render(scene, 0) == 0) {
BKE_report(reports, RPT_ERROR, "Full sample AA not supported without 3D rendering");
return 0;
@@ -2298,7 +2306,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
}
/* layer flag tests */
if (scene->r.scemode & R_SINGLE_LAYER) {
if (scemode & R_SINGLE_LAYER) {
srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
/* force layer to be enabled */
srl->layflag &= ~SCE_LAY_DISABLE;
@@ -2322,7 +2330,6 @@ static void validate_render_settings(Render *re)
if (re->r.osa == 0)
re->r.scemode &= ~R_FULL_SAMPLE;
}
else re->r.scemode &= ~R_FULL_SAMPLE; /* clear to be sure */
if (RE_engine_is_external(re)) {
/* not supported yet */