Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_engine.c
| Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | static void eevee_cache_finish(void *vedata) | ||||
| uint tot_samples = scene_eval->eevee.taa_render_samples; | uint tot_samples = scene_eval->eevee.taa_render_samples; | ||||
| if (tot_samples == 0) { | if (tot_samples == 0) { | ||||
| /* Use a high number of samples so the outputs accumulation buffers | /* Use a high number of samples so the outputs accumulation buffers | ||||
| * will have the highest possible precision. */ | * will have the highest possible precision. */ | ||||
| tot_samples = 1024; | tot_samples = 1024; | ||||
| } | } | ||||
| EEVEE_renderpasses_output_init(sldata, vedata, tot_samples); | EEVEE_renderpasses_output_init(sldata, vedata, tot_samples); | ||||
| /* Restart taa if a shader has finish compiling. */ | /* Restart TAA if a shader has finish compiling. */ | ||||
| /* HACK We should use notification of some sort from the compilation job instead. */ | /* HACK: We should use notification of some sort from the compilation job instead. */ | ||||
| if (g_data->queued_shaders_count != g_data->queued_shaders_count_prev) { | if (g_data->queued_shaders_count != g_data->queued_shaders_count_prev) { | ||||
| g_data->queued_shaders_count_prev = g_data->queued_shaders_count; | g_data->queued_shaders_count_prev = g_data->queued_shaders_count; | ||||
| EEVEE_temporal_sampling_reset(vedata); | EEVEE_temporal_sampling_reset(vedata); | ||||
| } | } | ||||
| } | } | ||||
| /* As renders in an HDR offscreen buffer, we need draw everything once | /* As renders in an HDR off-screen buffer, we need draw everything once | ||||
| * during the background pass. This way the other drawing callback between | * during the background pass. This way the other drawing callback between | ||||
| * the background and the scene pass are visible. | * the background and the scene pass are visible. | ||||
| * NOTE: we could break it up in two passes using some depth test | * NOTE: we could break it up in two passes using some depth test | ||||
| * to reduce the fillrate */ | * to reduce the fill-rate. */ | ||||
| static void eevee_draw_scene(void *vedata) | static void eevee_draw_scene(void *vedata) | ||||
| { | { | ||||
| EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl; | EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl; | ||||
| EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl; | EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl; | ||||
| EEVEE_FramebufferList *fbl = ((EEVEE_Data *)vedata)->fbl; | EEVEE_FramebufferList *fbl = ((EEVEE_Data *)vedata)->fbl; | ||||
| EEVEE_ViewLayerData *sldata = EEVEE_view_layer_data_ensure(); | EEVEE_ViewLayerData *sldata = EEVEE_view_layer_data_ensure(); | ||||
| /* Default framebuffer and texture */ | /* Default framebuffer and texture */ | ||||
| ▲ Show 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | case SCE_EEVEE_MB_START: | ||||
| break; | break; | ||||
| case SCE_EEVEE_MB_CENTER: | case SCE_EEVEE_MB_CENTER: | ||||
| time -= shuttertime * 0.5f; | time -= shuttertime * 0.5f; | ||||
| break; | break; | ||||
| case SCE_EEVEE_MB_END: | case SCE_EEVEE_MB_END: | ||||
| time -= shuttertime; | time -= shuttertime; | ||||
| break; | break; | ||||
| default: | default: | ||||
| BLI_assert(!"Invalid motion blur position enum!"); | BLI_assert_msg(0, "Invalid motion blur position enum!"); | ||||
| break; | break; | ||||
| } | } | ||||
| float time_step = shuttertime / time_steps_tot; | float time_step = shuttertime / time_steps_tot; | ||||
| for (int i = 0; i < time_steps_tot && !RE_engine_test_break(engine); i++) { | for (int i = 0; i < time_steps_tot && !RE_engine_test_break(engine); i++) { | ||||
| float time_prev = time; | float time_prev = time; | ||||
| float time_curr = time + time_step * 0.5f; | float time_curr = time + time_step * 0.5f; | ||||
| float time_next = time + time_step; | float time_next = time + time_step; | ||||
| ▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines | |||||