Eevee: Effects: Split each effect in it's own file.
This also: - make sure to only compile the shader needed by the active effects. - same thing for the shading groups. - disable TAA if motion blur is active (avoid infinite refresh).
This commit is contained in:
@@ -86,10 +86,17 @@ static void EEVEE_cache_init(void *vedata)
|
||||
EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl;
|
||||
EEVEE_SceneLayerData *sldata = EEVEE_scene_layer_data_get();
|
||||
|
||||
EEVEE_materials_cache_init(vedata);
|
||||
EEVEE_lights_cache_init(sldata, psl);
|
||||
EEVEE_lightprobes_cache_init(sldata, vedata);
|
||||
EEVEE_bloom_cache_init(sldata, vedata);
|
||||
EEVEE_depth_of_field_cache_init(sldata, vedata);
|
||||
EEVEE_effects_cache_init(sldata, vedata);
|
||||
EEVEE_lightprobes_cache_init(sldata, vedata);
|
||||
EEVEE_lights_cache_init(sldata, psl);
|
||||
EEVEE_materials_cache_init(vedata);
|
||||
EEVEE_motion_blur_cache_init(sldata, vedata);
|
||||
EEVEE_occlusion_cache_init(sldata, vedata);
|
||||
EEVEE_screen_raytrace_cache_init(sldata, vedata);
|
||||
EEVEE_temporal_sampling_cache_init(sldata, vedata);
|
||||
EEVEE_volumes_cache_init(sldata, vedata);
|
||||
}
|
||||
|
||||
static void EEVEE_cache_populate(void *vedata, Object *ob)
|
||||
@@ -220,11 +227,8 @@ static void EEVEE_draw_scene(void *vedata)
|
||||
EEVEE_create_minmax_buffer(vedata, dtxl->depth, -1);
|
||||
DRW_stats_group_end();
|
||||
|
||||
/* Compute GTAO Horizons */
|
||||
EEVEE_effects_do_gtao(sldata, vedata);
|
||||
|
||||
/* Restore main FB */
|
||||
DRW_framebuffer_bind(fbl->main);
|
||||
EEVEE_occlusion_compute(sldata, vedata);
|
||||
EEVEE_volumes_compute(sldata, vedata);
|
||||
|
||||
/* Shading pass */
|
||||
DRW_stats_group_start("Shading");
|
||||
@@ -233,18 +237,11 @@ static void EEVEE_draw_scene(void *vedata)
|
||||
DRW_draw_pass(psl->material_pass);
|
||||
DRW_stats_group_end();
|
||||
|
||||
/* Screen Space Reflections */
|
||||
DRW_stats_group_start("SSR");
|
||||
EEVEE_effects_do_ssr(sldata, vedata);
|
||||
DRW_stats_group_end();
|
||||
|
||||
/* Effects pre-transparency */
|
||||
EEVEE_reflection_compute(sldata, vedata);
|
||||
EEVEE_occlusion_draw_debug(sldata, vedata);
|
||||
DRW_draw_pass(psl->probe_display);
|
||||
|
||||
/* Prepare Refraction */
|
||||
EEVEE_effects_do_refraction(sldata, vedata);
|
||||
|
||||
/* Restore main FB */
|
||||
DRW_framebuffer_bind(fbl->main);
|
||||
EEVEE_refraction_compute(sldata, vedata);
|
||||
|
||||
/* Opaque refraction */
|
||||
DRW_stats_group_start("Opaque Refraction");
|
||||
@@ -253,16 +250,12 @@ static void EEVEE_draw_scene(void *vedata)
|
||||
DRW_draw_pass(psl->refract_pass);
|
||||
DRW_stats_group_end();
|
||||
|
||||
/* Volumetrics */
|
||||
DRW_stats_group_start("Volumetrics");
|
||||
EEVEE_effects_do_volumetrics(sldata, vedata);
|
||||
DRW_stats_group_end();
|
||||
/* Volumetrics Resolve Opaque */
|
||||
EEVEE_volumes_resolve(sldata, vedata);
|
||||
|
||||
/* Transparent */
|
||||
DRW_pass_sort_shgroup_z(psl->transparent_pass);
|
||||
DRW_stats_group_start("Transparent");
|
||||
DRW_draw_pass(psl->transparent_pass);
|
||||
DRW_stats_group_end();
|
||||
|
||||
/* Post Process */
|
||||
DRW_stats_group_start("Post FX");
|
||||
@@ -277,7 +270,7 @@ static void EEVEE_draw_scene(void *vedata)
|
||||
}
|
||||
}
|
||||
|
||||
EEVEE_effects_free_smoke_texture();
|
||||
EEVEE_volumes_free_smoke_textures();
|
||||
|
||||
stl->g_data->view_updated = false;
|
||||
}
|
||||
@@ -292,10 +285,17 @@ static void EEVEE_view_update(void *vedata)
|
||||
|
||||
static void EEVEE_engine_free(void)
|
||||
{
|
||||
EEVEE_materials_free();
|
||||
EEVEE_bloom_free();
|
||||
EEVEE_depth_of_field_free();
|
||||
EEVEE_effects_free();
|
||||
EEVEE_lights_free();
|
||||
EEVEE_lightprobes_free();
|
||||
EEVEE_lights_free();
|
||||
EEVEE_materials_free();
|
||||
EEVEE_motion_blur_free();
|
||||
EEVEE_occlusion_free();
|
||||
EEVEE_screen_raytrace_free();
|
||||
EEVEE_temporal_sampling_free();
|
||||
EEVEE_volumes_free();
|
||||
}
|
||||
|
||||
static void EEVEE_layer_collection_settings_create(RenderEngine *UNUSED(engine), IDProperty *props)
|
||||
|
||||
Reference in New Issue
Block a user