Eevee: Fix Aliasing in Light Probes

Differential Revision: https://developer.blender.org/D4869
This commit is contained in:
Adam Nydahl 2019-05-27 17:07:17 +02:00 committed by Clément Foucault
parent 7a308e65ef
commit 7353e0563e
4 changed files with 14 additions and 6 deletions

View File

@ -916,7 +916,7 @@ void BKE_scene_init(Scene *sce)
sce->eevee.gi_cubemap_draw_size = 0.3f;
sce->eevee.gi_irradiance_draw_size = 0.1f;
sce->eevee.gi_irradiance_smoothing = 0.1f;
sce->eevee.gi_filter_quality = 1.0f;
sce->eevee.gi_filter_quality = 3.0f;
sce->eevee.taa_samples = 16;
sce->eevee.taa_render_samples = 64;

View File

@ -458,6 +458,9 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
copy_v3_v3(scene->display.light_direction, (float[3]){M_SQRT1_3, M_SQRT1_3, M_SQRT1_3});
copy_v2_fl2(scene->safe_areas.title, 0.1f, 0.05f);
copy_v2_fl2(scene->safe_areas.action, 0.035f, 0.035f);
/* Change default cubemap quality. */
scene->eevee.gi_filter_quality = 3.0f;
}
if (app_template == NULL) {

View File

@ -1053,7 +1053,7 @@ void EEVEE_lightbake_filter_glossy(EEVEE_ViewLayerData *sldata,
/* 3 - Render to probe array to the specified layer, do prefiltering. */
int mipsize = GPU_texture_width(light_cache->cube_tx.tex);
for (int i = 0; i < maxlevel + 1; i++) {
float bias = (i == 0) ? -1.0f : 1.0f;
float bias = 0.0f;
pinfo->texel_size = 1.0f / (float)mipsize;
pinfo->padding_size = (i == maxlevel) ? 0 : (float)(1 << (maxlevel - i - 1));
pinfo->padding_size *= pinfo->texel_size;
@ -1063,22 +1063,27 @@ void EEVEE_lightbake_filter_glossy(EEVEE_ViewLayerData *sldata,
pinfo->roughness *= pinfo->roughness; /* Distribute Roughness accros lod more evenly */
CLAMP(pinfo->roughness, 1e-8f, 0.99999f); /* Avoid artifacts */
#if 1 /* Variable Sample count (fast) */
#if 1 /* Variable Sample count and bias (fast) */
switch (i) {
case 0:
pinfo->samples_len = 1.0f;
bias = -1.0f;
break;
case 1:
pinfo->samples_len = 16.0f;
pinfo->samples_len = 32.0f;
bias = 1.0f;
break;
case 2:
pinfo->samples_len = 32.0f;
pinfo->samples_len = 40.0f;
bias = 2.0f;
break;
case 3:
pinfo->samples_len = 64.0f;
bias = 2.0f;
break;
default:
pinfo->samples_len = 128.0f;
bias = 2.0f;
break;
}
#else /* Constant Sample count (slow) */

View File

@ -6584,7 +6584,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
prop = RNA_def_property(srna, "gi_filter_quality", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_float_default(prop, 3.0f);
RNA_def_property_ui_text(
prop, "Filter Quality", "Take more samples during cubemap filtering to remove artifacts");
RNA_def_property_range(prop, 1.0f, 8.0f);